diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..bf3241a2d9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# EditorConfig is awesome: http://EditorConfig.org + +root = true + +[*] +end_of_line = lf +insert_final_newline = true + +[*.{js,d.ts,json,html,md,sh}] +charset = utf-8 +indent_style = space +indent_size = 2 diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000000..17a489a8c3 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,2 @@ +# upgrade to prettier 3 +0355483c301dba5e215e2c3d113125a274444e38 diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000000..936cae52b0 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,105 @@ +# Have a question? + +Please ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/immutable.js) instead of opening a Github Issue. There are more people on Stack Overflow who +can answer questions, and good answers can be searchable and canonical. + +# Issues + +We use GitHub issues to track bugs. Please ensure your bug description is clear +and has sufficient instructions to be able to reproduce the issue. + +The absolute best way to report a bug is to submit a pull request including a +new failing test which describes the bug. When the bug is fixed, your pull +request can then be merged! + +The next best way to report a bug is to provide a reduced test case on jsFiddle +or jsBin or produce exact code inline in the issue which will reproduce the bug. + +# Code of Conduct + +Immutable.js is maintained within the [Contributor Covenant's Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/). + +# Pull Requests + +All active development of Immutable JS happens on GitHub. We actively welcome +your [pull requests](https://help.github.com/articles/creating-a-pull-request). + +1. Fork the repo and create your branch from `master`. +2. Install all dependencies. (`npm install`) +3. If you've added code, add tests. +4. If you've changed APIs, update the documentation. +5. Build generated JS, run tests and ensure your code passes lint. (`npm run test`) +6. If you haven't already, complete the Contributor License Agreement ("CLA"). + +## Documentation + +Documentation for Immutable.js (hosted at http://immutable-js.github.io/immutable-js) +is developed in `pages/`. Run `npm start` to get a local copy in your browser +while making edits. + +## Coding Style + +- 2 spaces for indentation (no tabs) +- 80 character line length strongly preferred. +- Prefer `'` over `"` +- ES6 Harmony when possible. +- Use semicolons; +- Trailing commas, +- Avd abbr wrds. + +# Functionality Testing + +Run the following command to build the library and test functionality: + +```bash +npm run test +``` + +## Performance Regression Testing + +Performance tests run against master and your feature branch. +Make sure to commit your changes in your local feature branch before proceeding. + +These commands assume you have a remote named `upstream` amd that you do not already have a local `master` branch: + +```bash +git fetch upstream +git checkout -b master upstream/master +``` + +These commands build `dist` and commit `dist/immutable.js` to `master` so that the regression tests can run. +```bash +npm run test +git add dist/immutable.js -f +git commit -m 'perf test prerequisite.' +``` + +Switch back to your feature branch, and run the following command to run regression tests: + +```bash +npm run test +npm run perf +``` + +Sample output: + +```bash +> immutable@4.0.0-rc.9 perf ~/github.com/immutable-js/immutable-js +> node ./resources/bench.js + +List > builds from array of 2 + Old: 678,974 683,071 687,218 ops/sec + New: 669,012 673,553 678,157 ops/sec + compare: 1 -1 + diff: -1.4% + rme: 0.64% +``` + +## TypeScript version support + +TypeScript version does support the same version as [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) versions. Immutable "may" work with older versions, but no support will be provided. + +## License + +By contributing to Immutable.js, you agree that your contributions will be +licensed under its MIT license. diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000000..4cf7679033 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [jdeniau, Methuselah96] diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000000..3387aa797e --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,42 @@ + + +### What happened + + + +### How to reproduce + + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..29c1b4a5d3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,139 @@ +name: CI + +on: + push: + branches: + - main + - 5.x + - 6.x + pull_request: ~ + +jobs: + lint: + name: 'Lint' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + - uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.OS }}-node- + - run: npm ci + - run: npm run lint + - run: npm run check-git-clean + + type-check: + name: 'Type Check' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + - uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.OS }}-node- + - uses: actions/cache@v4 + with: + path: ~/.dts + key: ${{ runner.OS }}-dts-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.OS }}-dts- + - run: npm ci + - run: npm run type-check + - run: npm run check-git-clean + + test: + name: 'Build & Unit Test & Type Test' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + - uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.OS }}-node- + - name: 'Install dependencies' + run: npm ci + + - name: 'Build JS files' + run: npm run build + + - name: 'Ensure all files are builded' + run: npm run check-build-output + + - name: 'Run unit tests' + run: npm run test:unit + + - name: 'Test types' + run: npm run test:types -- --target 4.5,5.0,current + + - run: npx size-limit + - run: npm run check-git-clean + + website: + name: 'Build Website' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: '20' + - uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.OS }}-node- + - run: npm ci + - run: NODE_OPTIONS=--openssl-legacy-provider npm run website:build + - run: npm run check-git-clean + + publish: + name: 'Publish' + needs: [lint, type-check, test, website] + if: github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: '20' + - uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.OS }}-node- + - run: npm ci + - run: npm run build + - run: NODE_OPTIONS=--openssl-legacy-provider npm run website:build + - name: Push NPM Branch + if: github.ref == 'refs/heads/main' + uses: peaceiris/actions-gh-pages@v3 + with: + enable_jekyll: true + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./npm + publish_branch: npm + user_name: 'github-actions[bot]' + user_email: 'github-actions[bot]@users.noreply.github.com' + - name: Publish Docs + if: github.ref == 'refs/heads/main' + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./website/out + cname: immutable-js.com + user_name: 'github-actions[bot]' + user_email: 'github-actions[bot]@users.noreply.github.com' diff --git a/.github/workflows/output_diff.yml b/.github/workflows/output_diff.yml new file mode 100644 index 0000000000..74690ee3cd --- /dev/null +++ b/.github/workflows/output_diff.yml @@ -0,0 +1,62 @@ +name: CI + +on: + pull_request: + branches: + - main + - init-migrate-to-ts + # run only if there is ts files in the PR + paths: + - 'src/**/*.ts' + +jobs: + diff: + name: 'Output diff' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + path: 'pr' + + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.base.sha }} + path: 'main' + + - uses: actions/setup-node@v4 + with: + node-version: '20' + + - uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.OS }}-node- + + - name: 'Install PR branch dependencies' + run: npm ci + working-directory: pr + + - name: 'Install main branch dependencies' + run: npm ci + working-directory: main + + - name: 'Build PR branch' + run: npm run build + working-directory: pr + + - name: 'Build main branch' + run: npm run build + working-directory: main + + - name: 'Execute prettier and remove ts-expect-error on PR dist' + run: npx terser dist/immutable.es.js --comments false | npx prettier --parser=babel > dist/immutable.es.prettier.js + + working-directory: pr + + - name: 'Execute prettier main dist' + run: npx terser dist/immutable.es.js --comments false | npx prettier --parser=babel > dist/immutable.es.prettier.js + working-directory: main + + - name: 'Output diff' + run: diff --unified --ignore-blank-lines --ignore-all-space main/dist/immutable.es.prettier.js pr/dist/immutable.es.prettier.js diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..ad6d4d72ad --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,39 @@ +name: Release + +on: + workflow_dispatch: ~ + release: + types: [published] + +jobs: + build: + name: 'Build & Publish to NPM' + permissions: + contents: read + id-token: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20' + registry-url: 'https://registry.npmjs.org' + - uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.OS }}-node- + - run: npm ci + - run: npm run build + - name: 'Determine NPM tag: latest or next depending if we are on a prerelease or not (version with hyphen should be a prerelease)' + id: npm_tag + run: | + VERSION=$(node -p "require('./package.json').version") + if [[ $VERSION == *-* ]]; then + echo "TAG=next" >> "$GITHUB_OUTPUT" + else + echo "TAG=latest" >> "$GITHUB_OUTPUT" + fi + - run: cd npm && npm publish --provenance --tag ${{ steps.npm_tag.outputs.TAG }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.gitignore b/.gitignore index 095813c5e3..972b88d8e1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,18 @@ .*.haste_cache.* node_modules -old npm-debug.log +yarn-error.log .DS_Store *~ *.swp +.idea +*.iml TODO -build +/website/.next +/website/out +/website/public/sitemap*.xml +/website/public/robots.txt +/gh-pages +/npm +/dist +/coverage \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..3b56666703 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,2 @@ +dist +type-definitions/flow-tests/ diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000000..544138be45 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "singleQuote": true +} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index fa80f3f8ac..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js - -sudo: false diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000..9df8e0fce0 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,703 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +Dates are formatted as YYYY-MM-DD. + +## Unreleased + +## 5.1.2 + +- Revert previous assertion as it introduced a regression [#2102](https://github.com/immutable-js/immutable-js/pull/2102) by [@giggo1604](https://github.com/giggo1604) +- Merge should work with empty record [#2103](https://github.com/immutable-js/immutable-js/pull/2103) by [@jdeniau](https://github.com/jdeniau) + +## 5.1.1 + +- Fix type copying + +## 5.1.0 + +- Add shuffle to list [#2066](https://github.com/immutable-js/immutable-js/pull/2066) by [@mazerty](https://github.com/mazerty) +- TypeScript: Better getIn `RetrievePath` [#2070](https://github.com/immutable-js/immutable-js/pull/2070) by [@jdeniau](https://github.com/jdeniau) +- Fix #1915 "Converting a Seq to a list causes RangeError (max call size exceeded)" by @alexvictoor in [#2038](https://github.com/immutable-js/immutable-js/pull/2038) +- TypeScript: Fix proper typings for Seq.concat() [#2040](https://github.com/immutable-js/immutable-js/pull/2040) by [@alexvictoor](https://github.com/alexvictoor) +- Fix Uncaught "TypeError: keyPath.slice is not a function" for ArrayLike method [#2065](https://github.com/immutable-js/immutable-js/pull/2065) by [@jdeniau](https://github.com/jdeniau) + +### Internal + +- Upgrade typescript and typescript-eslint [#2046](https://github.com/immutable-js/immutable-js/pull/2046) by [@jdeniau](https://github.com/jdeniau) +- Upgrade to rollup 4 [#2049](https://github.com/immutable-js/immutable-js/pull/2049) by [@jdeniau](https://github.com/jdeniau) +- Start migrating codebase to TypeScript without any runtime change nor .d.ts change: + - allow TS files to be compiled in src dir [#2054](https://github.com/immutable-js/immutable-js/pull/2054) by [@jdeniau](https://github.com/jdeniau) +- add exception for code that should not happen in updateIn [#2074](https://github.com/immutable-js/immutable-js/pull/2074) by [@jdeniau](https://github.com/jdeniau) +- Reformat Range.toString for readability [#2075](https://github.com/immutable-js/immutable-js/pull/2075) by [@Ustin.Vaskin](https://github.com/ustinvaskin) + +## [5.0.3] + +- Fix List.VNode.removeAfter() / removeBefore() issue on some particular case [#2030](https://github.com/immutable-js/immutable-js/pull/2030) by [@alexvictoor](https://github.com/alexvictoor) + +## [5.0.2] + +- Fix wrong path for esm module after fix in 5.0.1 + +## [5.0.1] + +- Fix circular dependency issue with ESM build by @iambumblehead in [#2035](https://github.com/immutable-js/immutable-js/pull/2035) by [@iambumblehead](https://github.com/iambumblehead) + +## [5.0.0] + +### Breaking changes + +To sum up, the **big** change in 5.0 is a Typescript change related to `Map` that is typed closer to the JS object. This is a huge change for TS users, but do not impact the runtime behavior. (see [Improve TypeScript definition for `Map`](#typescript-break-improve-typescript-definition-for-map) for more details) + +Other breaking changes are: + +#### [BREAKING] Remove deprecated methods: + +_Released in 5.0.0-rc.1_ + +- `Map.of('k', 'v')`: use `Map([ [ 'k', 'v' ] ])` or `Map({ k: 'v' })` +- `Collection.isIterable`: use `isIterable` directly +- `Collection.isKeyed`: use `isKeyed` directly +- `Collection.isIndexed`: use `isIndexed` directly +- `Collection.isAssociative`: use `isAssociative` directly +- `Collection.isOrdered`: use `isOrdered` directly + +#### [BREAKING] `OrdererMap` and `OrderedSet` hashCode implementation has been fixed + +_Released in 5.0.0-rc.1_ + +Fix issue implementation of `hashCode` for `OrdererMap` and `OrderedSet` where equal objects might not return the same `hashCode`. + +Changed in [#2005](https://github.com/immutable-js/immutable-js/pull/2005) + +#### [BREAKING] Range function needs at least two defined parameters + +_Released in 5.0.0-beta.5_ + +Range with `undefined` would end in an infinite loop. Now, you need to define at least the start and end values. + +If you need an infinite range, you can use `Range(0, Infinity)`. + +Changed in [#1967](https://github.com/immutable-js/immutable-js/pull/1967) by [@jdeniau](https://github.com/jdeniau) + +#### [Minor BC break] Remove default export + +_Released in 5.0.0-beta.1_ + +Immutable does not export a default object containing all it's API anymore. +As a drawback, you can not `immport Immutable` directly: + +```diff +- import Immutable from 'immutable'; ++ import { List, Map } from 'immutable'; + +- const l = Immutable.List([Immutable.Map({ a: 'A' })]); ++ const l = List([Map({ a: 'A' })]); +``` + +If you want the non-recommanded, but shorter migration path, you can do this: + +```diff +- import Immutable from 'immutable'; ++ import * as Immutable from 'immutable'; + + const l = Immutable.List([Immutable.Map({ a: 'A' })]); +``` + +#### [TypeScript Break] Improve TypeScript definition for `Map` + +_Released in 5.0.0-beta.1_ + +> If you do use TypeScript, then this change does not impact you : no runtime change here. +> But if you use Map with TypeScript, this is a HUGE change ! +> Imagine the following code + +```ts +const m = Map({ length: 3, 1: 'one' }); +``` + +This was previously typed as `Map` + +and return type of `m.get('length')` or `m.get('inexistant')` was typed as `string | number | undefined`. + +This made `Map` really unusable with TypeScript. + +Now the Map is typed like this: + +```ts +MapOf<{ + length: number; + 1: string; +}>; +``` + +and the return type of `m.get('length')` is typed as `number`. + +The return of `m.get('inexistant')` throw the TypeScript error: + +> Argument of type '"inexistant"' is not assignable to parameter of type '1 | "length" + +##### If you want to keep the old definition + +**This is a minor BC for TS users**, so if you want to keep the old definition, you can declare you Map like this: + +```ts +const m = Map({ length: 3, 1: 'one' }); +``` + +##### If you need to type the Map with a larger definition + +You might want to declare a wider definition, you can type your Map like this: + +```ts +type MyMapType = { + length: number; + 1: string | null; + optionalProperty?: string; +}; +const m = Map({ length: 3, 1: 'one' }); +``` + +Keep in mind that the `MapOf` will try to be consistant with the simple TypeScript object, so you can not do this: + +```ts +Map({ a: 'a' }).set('b', 'b'); +Map({ a: 'a' }).delete('a'); +``` + +Like a simple object, it will only work if the type is forced: + +```ts +Map<{ a: string; b?: string }>({ a: 'a' }).set('b', 'b'); // b is forced in type and optional +Map<{ a?: string }>({ a: 'a' }).delete('a'); // you can only delete an optional key +``` + +##### Are all `Map` methods implemented ? + +For now, only `get`, `getIn`, `set`, `update`, `delete`, `remove`, `toJS`, `toJSON` methods are implemented. All other methods will fallback to the basic `Map` definition. Other method definition will be added later, but as some might be really complex, we prefer the progressive enhancement on the most used functions. + +### Fixes + +- Fix type inference for first() and last() [#2001](https://github.com/immutable-js/immutable-js/pull/2001) by [@butchler](https://github.com/butchler) +- Fix issue with empty list that is a singleton [#2004](https://github.com/immutable-js/immutable-js/pull/2004) by [@jdeniau](https://github.com/jdeniau) +- Map and Set sort and sortBy return type [#2013](https://github.com/immutable-js/immutable-js/pull/2013) by [@jdeniau](https://github.com/jdeniau) + +### Internal + +- [Internal] Migrating TS type tests from dtslint to [TSTyche](https://tstyche.org/) [#1988](https://github.com/immutable-js/immutable-js/pull/1988) and [#1991](https://github.com/immutable-js/immutable-js/pull/1991) by [@mrazauskas](https://github.com/mrazauskas). + Special thanks to [@arnfaldur](https://github.com/arnfaldur) that migrated every type tests to tsd just before that. +- [internal] Upgrade to rollup 3.x [#1965](https://github.com/immutable-js/immutable-js/pull/1965) by [@jdeniau](https://github.com/jdeniau) +- [internal] upgrade tooling (TS, eslint) and documentation packages: #1971, #1972, #1973, #1974, #1975, #1976, #1977, #1978, #1979, #1980, #1981 + +## [4.3.7] - 2024-07-22 + +- Fix issue with slice negative of filtered sequence [#2006](https://github.com/immutable-js/immutable-js/pull/2006) by [@jdeniau](https://github.com/jdeniau) + +## [4.3.6] - 2024-05-13 + +- Fix `Repeat().equals(undefined)` incorrectly returning true [#1994](https://github.com/immutable-js/immutable-js/pull/1994) by [@butchler](https://github.com/butchler) + +## [4.3.5] - 2024-01-16 + +- Upgrade to TS 5.1 [#1972](https://github.com/immutable-js/immutable-js/pull/1972) by [@jdeniau](https://github.com/jdeniau) +- Fix Set.fromKeys types with Map constructor in TS 5.0 [#1971](https://github.com/immutable-js/immutable-js/pull/1971) by [@jdeniau](https://github.com/jdeniau) +- Fix Read the Docs link on readme [#1970](https://github.com/immutable-js/immutable-js/pull/1970) by [@joshding](https://github.com/joshding) + +## [4.3.4] - 2023-08-25 + +- Rollback toJS type due to circular reference error [#1958](https://github.com/immutable-js/immutable-js/pull/1958) by [@jdeniau](https://github.com/jdeniau) + +## [4.3.3] - 2023-08-23 + +- [typescript] manage to handle toJS circular reference. [#1932](https://github.com/immutable-js/immutable-js/pull/1932) by [@jdeniau](https://github.com/jdeniau) +- [doc] Add install instructions for pnpm and Bun [#1952](https://github.com/immutable-js/immutable-js/pull/1952) by [@colinhacks](https://github.com/colinhacks) and [#1953](https://github.com/immutable-js/immutable-js/pull/1953) by [@menglingyu659](https://github.com/menglingyu659) + +## [4.3.2] - 2023-08-01 + +- [TypeScript] Fix isOrderedSet type [#1948](https://github.com/immutable-js/immutable-js/pull/1948) + +## [4.3.1] - 2023-07-11 + +- Faster and implementation of `some` [#1944](https://github.com/immutable-js/immutable-js/pull/1944) +- [internal] remove unused exports [#1928](https://github.com/immutable-js/immutable-js/pull/1928) + +## [4.3.0] - 2023-03-10 + +- Introduce Comparator and PairSorting [#1937](https://github.com/immutable-js/immutable-js/pull/1937) by [@https://github.com/giancosta86](https://github.com/giancosta86) +- [TypeScript] Fix fromJS declaration for greater compatibility [#1936](https://github.com/immutable-js/immutable-js/pull/1936) + +## [4.2.4] - 2023-02-06 + +- [TypeScript] Improve type infererence for from JS by [KSXGitHub](https://github.com/KSXGitHub) [#1927](https://github.com/immutable-js/immutable-js/pull/1927) + +## [4.2.3] - 2023-02-02 + +- [TypeScript] `groupBy` return either a `Map` or an `OrderedMap`: make the type more precise than base `Collection` [#1924](https://github.com/immutable-js/immutable-js/pull/1924) + +## [4.2.2] - 2023-01-02 + +- [Flow] Add type for `partition` method [#1920](https://github.com/immutable-js/immutable-js/pull/1920) by [Dagur](https://github.com/Dagur) + +## [4.2.1] - 2022-12-23 + +- [Typescript] rollback some of the change on `toJS` to avoir circular reference + +## [4.2.0] - 2022-12-22 + +- [TypeScript] Better type for toJS [#1917](https://github.com/immutable-js/immutable-js/pull/1917) by [jdeniau](https://github.com/jdeniau) + - [TS Minor Break] tests are ran with TS > 4.5 only. It was tested with TS > 2.1 previously, but we want to level up TS types with recent features. TS 4.5 has been released more than one year before this release. If it does break your implementation (it might not), you should probably consider upgrading to the latest TS version. +- Added a `partition` method to all containers [#1916](https://github.com/immutable-js/immutable-js/pull/1916) by [johnw42](https://github.com/johnw42) + +## [4.1.0] - 2022-05-23 + +- Accept Symbol as Map key. [#1859](https://github.com/immutable-js/immutable-js/pull/1859) by [jdeniau](https://github.com/jdeniau) +- Optimize contructors without arguments [#1887](https://github.com/immutable-js/immutable-js/pull/1887) by [marianoguerra](https://github.com/marianoguerra) +- Fix Flow removeIn types [#1902](https://github.com/immutable-js/immutable-js/pull/1902) by [nifgraup](https://github.com/nifgraup) +- Fix bug in Record.equals when comparing against Map [#1903](https://github.com/immutable-js/immutable-js/pull/1903) by [jmtoung](https://github.com/jmtoung) + +## [4.0.0] - 2021-09-30 + +This release brings new functionality and many fixes. + +1. [Key changes](#key-changes) +1. [Note for users of v4.0.0-rc.12](#note-for-users-of-v400-rc12) +1. [Breaking changes](#breaking) +1. [New](#new) +1. [Fixed](#fixed) + +### Key changes + +- New members have joined the team +- The project has been relicensed as MIT +- Better TypeScript and Flow type definitions +- A brand-new documentation lives at [immutable-js.com](https://immutable-js.com/) and can show multiple versions +- Behavior of `merge` and `mergeDeep` has changed +- `Iterable` is renamed to [Collection](https://immutable-js.com/docs/latest@main/Collection/) +- [Records](https://immutable-js.com/docs/latest@main/Record/) no longer extend from Collections +- All collection types now implement the [ES6 iterable protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol) +- New methods: + - [toJSON()]() + - [wasAltered()]() + - [Collection.Indexed.zipAll()]() + - [Map.deleteAll()]() + +
   Diff of changed API (click to expand) + +```diff ++ Collection.[Symbol.iterator] ++ Collection.toJSON ++ Collection.update ++ Collection.Indexed.[Symbol.iterator] ++ Collection.Indexed.toJSON ++ Collection.Indexed.update ++ Collection.Indexed.zipAll ++ Collection.Keyed.[Symbol.iterator] ++ Collection.Keyed.toJSON ++ Collection.Keyed.update ++ Collection.Set.[Symbol.iterator] ++ Collection.Set.toJSON ++ Collection.Set.update +- Collection.size +- Collection.Indexed.size +- Collection.Keyed.size +- Collection.Set.size + ++ List.[Symbol.iterator] ++ List.toJSON ++ List.wasAltered ++ List.zipAll +- List.mergeDeep +- List.mergeDeepWith +- List.mergeWith + ++ Map.[Symbol.iterator] ++ Map.deleteAll ++ Map.toJSON ++ Map.wasAltered + ++ OrderedMap.[Symbol.iterator] ++ OrderedMap.deleteAll ++ OrderedMap.toJSON ++ OrderedMap.wasAltered ++ OrderedSet.[Symbol.iterator] ++ OrderedSet.toJSON ++ OrderedSet.update ++ OrderedSet.wasAltered ++ OrderedSet.zip ++ OrderedSet.zipAll ++ OrderedSet.zipWith + ++ Record.[Symbol.iterator] ++ Record.asImmutable ++ Record.asMutable ++ Record.clear ++ Record.delete ++ Record.deleteIn ++ Record.merge ++ Record.mergeDeep ++ Record.mergeDeepIn ++ Record.mergeDeepWith ++ Record.mergeIn ++ Record.mergeWith ++ Record.set ++ Record.setIn ++ Record.toJSON ++ Record.update ++ Record.updateIn ++ Record.wasAltered ++ Record.withMutations ++ Record.Factory.displayName +- Record.butLast +- Record.concat +- Record.count +- Record.countBy +- Record.entries +- Record.entrySeq +- Record.every +- Record.filter +- Record.filterNot +- Record.find +- Record.findEntry +- Record.findKey +- Record.findLast +- Record.findLastEntry +- Record.findLastKey +- Record.first +- Record.flatMap +- Record.flatten +- Record.flip +- Record.forEach +- Record.groupBy +- Record.includes +- Record.isEmpty +- Record.isSubset +- Record.isSuperset +- Record.join +- Record.keyOf +- Record.keySeq +- Record.keys +- Record.last +- Record.lastKeyOf +- Record.map +- Record.mapEntries +- Record.mapKeys +- Record.max +- Record.maxBy +- Record.min +- Record.minBy +- Record.reduce +- Record.reduceRight +- Record.rest +- Record.reverse +- Record.skip +- Record.skipLast +- Record.skipUntil +- Record.skipWhile +- Record.slice +- Record.some +- Record.sort +- Record.sortBy +- Record.take +- Record.takeLast +- Record.takeUntil +- Record.takeWhile +- Record.toArray +- Record.toIndexedSeq +- Record.toKeyedSeq +- Record.toList +- Record.toMap +- Record.toOrderedMap +- Record.toOrderedSet +- Record.toSet +- Record.toSetSeq +- Record.toStack +- Record.valueSeq +- Record.values + ++ Seq.[Symbol.iterator] ++ Seq.toJSON ++ Seq.update ++ Seq.Indexed.[Symbol.iterator] ++ Seq.Indexed.toJSON ++ Seq.Indexed.update ++ Seq.Indexed.zipAll ++ Seq.Keyed.[Symbol.iterator] ++ Seq.Keyed.toJSON ++ Seq.Keyed.update ++ Seq.Set.[Symbol.iterator] ++ Seq.Set.toJSON ++ Seq.Set.update + ++ Set.[Symbol.iterator] ++ Set.toJSON ++ Set.update ++ Set.wasAltered + ++ Stack.[Symbol.iterator] ++ Stack.toJSON ++ Stack.update ++ Stack.wasAltered ++ Stack.zipAll + ++ ValueObject.equals ++ ValueObject.hashCode + +- Iterable.* +- Iterable.Indexed.* +- Iterable.Keyed.* +- Iterable.Set.* +``` + +
+ +### Note for users of v4.0.0-rc.12 + +There were mostly bugfixes and improvements since RC 12. Upgrading should be painless for most users. +However, there is **one breaking change**: The behavior of `merge` and `mergeDeep` has changed. See below for details. + +### BREAKING + +#### [merge()]() + +- No longer use value-equality within `merge()` ([#1391](https://github.com/immutable-js/immutable-js/pull/1391)) + + > This rectifies an inconsistent behavior between `x.merge(y)` and `x.mergeDeep(y)` where merge would + > use `===` on leaf values to determine return-self optimizations, while mergeDeep would use `is()`. + > This improves consistency across the library and avoids a possible performance pitfall. + +- No longer deeply coerce argument to merge() ([#1339](https://github.com/immutable-js/immutable-js/pull/1339)) + > Previously, the argument provided to `merge()` was deeply converted to Immutable collections via `fromJS()`. + > This was the only function in the library which calls `fromJS()` indirectly, + > and it was surprising and made it difficult to understand what the result of `merge()` would be. + > Now, the value provided to `merge()` is only shallowly converted to an Immutable collection, similar to + > related methods in the library. This may change the behavior of your calls to `merge()`. + +#### [mergeDeep()]() + +- Replace incompatible collections when merging nested data ([#1840](https://github.com/immutable-js/immutable-js/pull/1840)) + + > It will no longer merge lists of tuples into maps. For more information see + > [#1840](https://github.com/immutable-js/immutable-js/pull/1840) and the updated `mergeDeep()` documentation. + +- Concat Lists when merging deeply ([#1344](https://github.com/immutable-js/immutable-js/pull/1344)) + > Previously, calling `map.mergeDeep()` with a value containing a `List` would replace the values in the + > original List. This has always been confusing, and does not properly treat `List` as a monoid. + > Now, `List.merge` is simply an alias for `List.concat`, and `map.mergeDeep()` will concatenate deeply-found lists + > instead of replacing them. + +#### [Seq](https://immutable-js.com/docs/latest@main/Seq/) + +- Remove IteratorSequence. Do not attempt to detect iterators in `Seq()`. ([#1589](https://github.com/immutable-js/immutable-js/pull/1589)) + + > Iterables can still be provided to `Seq()`, and _most_ Iterators are also + > Iterables, so this change should not affect the vast majority of uses. + > For more information, see PR #1589 + +- Remove `Seq.of()` (#1311, #1310) + > This method has been removed since it cannot be correctly typed. It's recommended to convert + > `Seq.of(1, 2, 3)` to `Seq([1, 2, 3])`. + +#### [isImmutable()]() + +- `isImmutable()` now returns true for collections currently within a `withMutations()` call. ([#1374](https://github.com/immutable-js/immutable-js/pull/1374)) + + > Previously, `isImmutable()` did double-duty of both determining if a value was a Collection or Record + > from this library as well as if it was outside a `withMutations()` call. + > This latter case caused confusion and was rarely used. + +#### [toArray()]() + +- KeyedCollection.toArray() returns array of tuples. ([#1340](https://github.com/immutable-js/immutable-js/pull/1340)) + + > Previously, calling `toArray()` on a keyed collection (incl `Map` and `OrderedMap`) would + > discard keys and return an Array of values. This has always been confusing, and differs from `Array.from()`. + > Now, calling `toArray()` on a keyed collection will return an Array of `[key, value]` tuples, matching + > the behavior of `Array.from()`. + +#### [concat()]() + +- `list.concat()` now has a slightly more efficient implementation and `map.concat()` is an alias for `map.merge()`. ([#1373](https://github.com/immutable-js/immutable-js/pull/1373)) + + > In rare cases, this may affect use of `map.concat()` which expected slightly different behavior from `map.merge()`. + +#### [Collection](https://immutable-js.com/docs/latest@main/Collection/), formerly `Iterable` + +- The `Iterable` class has been renamed to `Collection`, and `isIterable()` has been renamed to `isCollection()`. + Aliases with the existing names exist to make transitioning code easier. + +#### [Record](https://immutable-js.com/docs/latest@main/Record/) + +- Record is no longer an Immutable Collection type. + - Now `isCollection(myRecord)` returns `false` instead of `true`. + - The sequence API (such as `map`, `filter`, `forEach`) no longer exist on Records. + - `delete()` and `clear()` no longer exist on Records. + +#### Other breaking changes + +- **Potentially Breaking:** Improve hash speed and avoid collision for common values ([#1629](https://github.com/immutable-js/immutable-js/pull/1629)) + + > Causes some hash values to change, which could impact the order of iteration of values in some Maps + > (which are already advertised as unordered, but highlighting just to be safe) + +- Node buffers no longer considered value-equal ([#1437](https://github.com/immutable-js/immutable-js/pull/1437)) + +- Plain Objects and Arrays are no longer considered opaque values ([#1369](https://github.com/immutable-js/immutable-js/pull/1369)) + + > This changes the behavior of a few common methods with respect to plain Objects and Arrays where these were + > previously considered opaque to `merge()` and `setIn()`, they now are treated as collections and can be merged + > into and updated (persistently). This offers an exciting alternative to small Lists and Records. + +- The "predicate" functions, `isCollection`, `isKeyed`, `isIndexed`, `isAssociative` have been moved from `Iterable.` to the top level exports. + +- The `toJSON()` method performs a shallow conversion (previously it was an alias for `toJS()`, which remains a deep conversion). + +- Some minor implementation details have changed, which may require updates to libraries which deeply integrate with Immutable.js's private APIs. + +- The Cursor API is officially deprecated. Use [immutable-cursor](https://github.com/redbadger/immutable-cursor) instead. + +- **Potentially Breaking:** [TypeScript] Remove `Iterable` as tuple from Map constructor types ([#1626](https://github.com/immutable-js/immutable-js/pull/1626)) + > Typescript allowed constructing a Map with a list of List instances, assuming each was a key, value pair. + > While this runtime behavior still works, this type led to more issues than it solved, so it has been removed. + > (Note, this may break previous v4 rcs, but is not a change against v3) + +### New + +- Update TypeScript and Flow definitions: + - The Flowtype and TypeScript type definitions have been completely rewritten with much higher quality and accuracy, + taking advantage of the latest features from both tools. + - Simplified TypeScript definition files to support all UMD use cases ([#1854](https://github.com/immutable-js/immutable-js/pull/1854)) + - Support Typescript 3 ([#1593](https://github.com/immutable-js/immutable-js/pull/1593)) + - Support Typescript strictNullChecks ([#1168](https://github.com/immutable-js/immutable-js/pull/1168)) + - Flow types to be compatible with the latest version 0.160.0 + - Enable flow strict ([#1580](https://github.com/immutable-js/immutable-js/pull/1580)) + + + +- Add "sideEffects: false" to package.json ([#1661](https://github.com/immutable-js/immutable-js/pull/1661)) + +- Use ES standard for iterator method reuse ([#1867](https://github.com/immutable-js/immutable-js/pull/1867)) + +- Generalize `fromJS()` and `Seq()` to support Sets ([#1865](https://github.com/immutable-js/immutable-js/pull/1865)) + +- Top level predicate functions ([#1600](https://github.com/immutable-js/immutable-js/pull/1600)) + + > New functions are exported from the `immutable` module: + > `isSeq()`, `isList()`, `isMap()`, `isOrderedMap()`, `isStack()`, `isSet()`, `isOrderedSet()`, and `isRecord()`. + +- Improve performance of toJS ([#1581](https://github.com/immutable-js/immutable-js/pull/1581)) + + > Cursory test is >10% faster than both v3.8.2 and v4.0.0-rc.7, + > and corrects the regression since v4.0.0-rc.9. + +- Added optional `notSetValue` in `first()` and `last()` ([#1556](https://github.com/immutable-js/immutable-js/pull/1556)) + +- Make `isArrayLike` check more precise to avoid false positives ([#1520](https://github.com/immutable-js/immutable-js/pull/1520)) + +- `map()` for List, Map, and Set returns itself for no-ops ([#1455](https://github.com/immutable-js/immutable-js/pull/1455)) (5726bd1) + +- Hash functions as objects, allowing functions as values in collections ([#1485](https://github.com/immutable-js/immutable-js/pull/1485)) + +- Functional API for `get()`, `set()`, and more which support both Immutable.js collections and plain Objects and Arrays ([#1369](https://github.com/immutable-js/immutable-js/pull/1369)) + +- Relicensed as MIT ([#1320](https://github.com/immutable-js/immutable-js/pull/1320)) + +- Support for Transducers! ([ee9c68f1](https://github.com/immutable-js/immutable-js/commit/ee9c68f1d43da426498ee009ecea37aa2ef77cb8)) + +- Add new method, `zipAll()` ([#1195](https://github.com/immutable-js/immutable-js/pull/1195)) + +- Bundle and distribute an "es module" so Webpack and Rollup can use tree-shaking for smaller builds ([#1204](https://github.com/immutable-js/immutable-js/pull/1204)) + +- Warn instead of throw when `getIn()` has a bad path ([668f2236](https://github.com/immutable-js/immutable-js/commit/668f2236642c97bd4e7d8dfbf62311f497a6ac18)) + +- A new predicate function `isValueObject()` helps to detect objects which implement `equals()` and `hashCode()`, + and type definitions now define the interface `ValueObject` which you can implement in your own code to create objects which + behave as values and can be keys in Maps or entries in Sets. + +- Using `fromJS()` with a "reviver" function now provides access to the key path to each translated value. ([#1118](https://github.com/immutable-js/immutable-js/pull/1118)) + +### Fixed + +- Fix issue with IE11 and missing Symbol.iterator ([#1850](https://github.com/immutable-js/immutable-js/pull/1850)) + +- Fix ordered set with map ([#1663](https://github.com/immutable-js/immutable-js/pull/1663)) + +- Do not modify iter during List.map and Map.map ([#1649](https://github.com/immutable-js/immutable-js/pull/1649)) + +- Fix ordered map delete all ([#1777](https://github.com/immutable-js/immutable-js/pull/1777)) + +- Hash symbols as objects ([#1753](https://github.com/immutable-js/immutable-js/pull/1753)) + +- Fix returning a Record in merge() when Record is empty ([#1785](https://github.com/immutable-js/immutable-js/pull/1785)) + +- Fix for RC~12: Records from different factories aren't equal ([#1734](https://github.com/immutable-js/immutable-js/issues/1734)) + +- "too much recursion" error when creating a Record type from an instance of another Record ([#1690](https://github.com/immutable-js/immutable-js/pull/1690)) + +- Fix glob for npm format script on Windows ([#18](https://github.com/immutable-js-oss/immutable-js/pull/18)) + +- Remove deprecated cursor API ([#13](https://github.com/immutable-js-oss/immutable-js/issues/13)) + +- Add missing es exports ([#1740](https://github.com/immutable-js/immutable-js/pull/1740)) + +- Support nulls in genTypeDefData.js ([#185](https://github.com/immutable-js/immutable-js/pull/185)) + +- Support isPlainObj in IE11 and other esoteric parameters [f3a6d5ce](https://github.com/immutable-js/immutable-js/pull/1833/commits/f3a6d5ce75bb9d60b87074240838f5429e896b60) + +- `Set.map` produces valid underlying map ([#1606](https://github.com/immutable-js/immutable-js/pull/1606)) + +- Support isPlainObj with `constructor` key ([#1627](https://github.com/immutable-js/immutable-js/pull/1627)) + +- `groupBy` no longer returns a mutable Map instance ([#1602](https://github.com/immutable-js/immutable-js/pull/1602)) + +- Fix issue where refs can recursively collide, corrupting `.size` ([#1598](https://github.com/immutable-js/immutable-js/pull/1598)) + +- Throw error in `mergeWith()` method if missing the required `merger` function ([#1543](https://github.com/immutable-js/immutable-js/pull/1543)) + +- Update `isPlainObj()` to workaround Safari bug and allow cross-realm values ([#1557](https://github.com/immutable-js/immutable-js/pull/1557)) + +- Fix missing "& T" to some methods in RecordInstance ([#1464](https://github.com/immutable-js/immutable-js/pull/1464)) + +- Make notSetValue optional for typed Records ([#1461](https://github.com/immutable-js/immutable-js/pull/1461)) (a1029bb) + +- Export type of RecordInstance ([#1434](https://github.com/immutable-js/immutable-js/pull/1434)) + +- Fix Record `size` check in merge() ([#1521](https://github.com/immutable-js/immutable-js/pull/1521)) + +- Fix Map#concat being not defined ([#1402](https://github.com/immutable-js/immutable-js/pull/1402)) + + + + + +- `getIn()` no longer throws when encountering a missing path ([#1361](https://github.com/immutable-js/immutable-js/pull/1361)) + + + +- Do not throw when printing value that cannot be coerced to primitive ([#1334](https://github.com/immutable-js/immutable-js/pull/1334)) + + + + + +- Do not throw from hasIn ([#1319](https://github.com/immutable-js/immutable-js/pull/1319)) + +- Long hash codes no longer cause an infinite loop ([#1175](https://github.com/immutable-js/immutable-js/pull/1175)) + +- `slice()` which should return an empty set could return a full set or vice versa (#1245, #1287) + +- Ensure empty slices do not throw when iterated ([#1220](https://github.com/immutable-js/immutable-js/pull/1220)) + +- Error during equals check on Record with undefined or null ([#1208](https://github.com/immutable-js/immutable-js/pull/1208)) + +- Fix size of count() after filtering or flattening ([#1171](https://github.com/immutable-js/immutable-js/pull/1171)) + +## [3.8.2] - 2017-10-05 + +Released in 2017, still the most commonly used release. + +[unreleased]: https://github.com/immutable-js/immutable-js/compare/v4.0.0-rc.15...HEAD +[4.0.0]: https://github.com/immutable-js/immutable-js/compare/v3.8.2...v4.0.0-rc.15 +[3.8.2]: https://github.com/immutable-js/immutable-js/compare/3.7.6...v3.8.2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 51e89d1a24..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,61 +0,0 @@ -# Contributing to Immutable JS - -We want to make contributing to this project as easy and transparent as -possible. Hopefully this document makes the process for contributing clear and -answers any questions you may have. If not, feel free to open an -[Issue](https://github.com/facebook/immutable-js/issues). - -## Pull Requests - -All active development of Immutable JS happens on GitHub. We actively welcome -your [pull requests](https://help.github.com/articles/creating-a-pull-request). - - 1. Fork the repo and create your branch from `master`. - 2. Install all dependencies. (`npm install`) - 3. Install the grunt CLI tools. (`npm install -g grunt-cli`) - 4. If you've added code, add tests. - 5. If you've changed APIs, update the documentation. - 6. Build generated JS, run tests and ensure your code passes lint. (`grunt`) - 7. Be sure to commit the generated JS in `/dist`. - 8. If you haven't already, complete the Contributor License Agreement ("CLA"). - -## Contributor License Agreement ("CLA") - -In order to accept your pull request, we need you to submit a CLA. You only need -to do this once to work on any of Facebook's open source projects. - -Complete your CLA here: - -## `master` is unsafe - -We will do our best to keep `master` in good shape, with tests passing at all -times. But in order to move fast, we might make API changes that your -application might not be compatible with. We will do our best to communicate -these changes and always [version](http://semver.org/) appropriately so you can -lock into a specific version if need be. If any of this is worrysome to you, -just use [npm](https://www.npmjs.org/package/immutable). - -## Issues - -We use GitHub issues to track public bugs and requests. Please ensure your bug -description is clear and has sufficient instructions to be able to reproduce the -issue. The best way is to provide a reduced test case on jsFiddle or jsBin. - -Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe -disclosure of security bugs. In those cases, please go through the process -outlined on that page and do not file a public issue. - -## Coding Style - -* 2 spaces for indentation (no tabs) -* 80 character line length strongly preferred. -* Prefer `'` over `"` -* ES6 Harmony when possible. -* Use semicolons; -* Trailing commas, -* Avd abbr wrds. - -## License - -By contributing to Immutable JS, you agree that your contributions will be -licensed under its BSD license. diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index 28bb759046..0000000000 --- a/Gruntfile.js +++ /dev/null @@ -1,216 +0,0 @@ -/** - * - * grunt lint Lint all source javascript - * grunt clean Clean dist folder - * grunt build Build dist javascript - * grunt test Test dist javascript - * grunt default Lint, Build then Test - * - */ -module.exports = function(grunt) { - grunt.initConfig({ - jshint: { - options: { - asi: true, - curly: false, - eqeqeq: true, - esnext: true, - expr: true, - forin: true, - freeze: false, - immed: true, - indent: 2, - iterator: true, - noarg: true, - node: true, - noempty: true, - nonstandard: true, - trailing: true, - undef: true, - unused: 'vars', - }, - all: ['src/**/*.js'] - }, - clean: { - build: ['dist/*'] - }, - bundle: { - build: { - files: [{ - src: 'src/Immutable.js', - dest: 'dist/immutable' - }] - } - }, - copy: { - build: { - files: [{ - src: 'type-definitions/Immutable.d.ts', - dest: 'dist/immutable.d.ts' - }] - } - }, - jest: { - options: { - testPathPattern: /.*/ - } - } - }); - - - var fs = require('fs'); - var esperanto = require('esperanto'); - var declassify = require('./resources/declassify'); - var stripCopyright = require('./resources/stripCopyright'); - var uglify = require('uglify-js'); - - grunt.registerMultiTask('bundle', function () { - var done = this.async(); - - this.files.map(function (file) { - esperanto.bundle({ - entry: file.src[0], - transform: function(source) { - return declassify(stripCopyright(source)); - } - }).then(function (bundle) { - var copyright = fs.readFileSync('resources/COPYRIGHT'); - - var bundled = bundle.toUmd({ - banner: copyright, - name: 'Immutable' - }).code; - - var es6 = require('es6-transpiler'); - - var transformResult = require("es6-transpiler").run({ - src: bundled, - disallowUnknownReferences: false, - environments: ["node", "browser"], - globals: { - define: false, - }, - }); - - if (transformResult.errors && transformResult.errors.length > 0) { - throw new Error(transformResult.errors[0]); - } - - var transformed = transformResult.src; - - fs.writeFileSync(file.dest + '.js', transformed); - - var minifyResult = uglify.minify(transformed, { - fromString: true, - mangle: { - toplevel: true - }, - compress: { - comparisons: true, - pure_getters: true, - unsafe: true - }, - output: { - max_line_len: 2048, - }, - reserved: ['module', 'define', 'Immutable'] - }); - - var minified = minifyResult.code; - - fs.writeFileSync(file.dest + '.min.js', copyright + minified); - }).then(function(){ done(); }, function(error) { - grunt.log.error(error.stack); - done(false); - }); - }); - }); - - - var Promise = require("bluebird"); - var exec = require('child_process').exec; - - function execp(cmd) { - var resolve, reject; - var promise = new Promise(function(_resolve, _reject) { - resolve = _resolve; - reject = _reject; - }); - try { - exec(cmd, function (error, out) { - if (error) { - reject(error); - } else { - resolve(out); - } - }); - } catch (error) { - reject(error); - } - return promise; - } - - grunt.registerTask('stats', function () { - Promise.all([ - execp('cat dist/immutable.js | wc -c'), - execp('git show master:dist/immutable.js | wc -c'), - execp('cat dist/immutable.min.js | wc -c'), - execp('git show master:dist/immutable.min.js | wc -c'), - execp('cat dist/immutable.min.js | gzip -c | wc -c'), - execp('git show master:dist/immutable.min.js | gzip -c | wc -c'), - ]).then(function (results) { - return results.map(function (result) { return parseInt(result); }); - }).then(function (results) { - var rawNew = results[0]; - var rawOld = results[1]; - var minNew = results[2]; - var minOld = results[3]; - var zipNew = results[4]; - var zipOld = results[5]; - - function space(n, s) { - return Array(Math.max(0, 10 + n - (s||'').length)).join(' ') + (s||''); - } - - function bytes(b) { - return b.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',') + ' bytes'; - } - - function diff(n, o) { - var d = n - o; - return d === 0 ? '' : d < 0 ? (' ' + bytes(d)).green : (' +' + bytes(d)).red; - } - - function pct(s, b) { - var p = Math.floor(10000 * (1 - (s / b))) / 100; - return (' ' + p + '%').grey; - } - - console.log(' Raw: ' + - space(14, bytes(rawNew).cyan) + ' ' + space(15, diff(rawNew, rawOld)) - ); - console.log(' Min: ' + - space(14, bytes(minNew).cyan) + pct(minNew, rawNew) + space(15, diff(minNew, minOld)) - ); - console.log(' Zip: ' + - space(14, bytes(zipNew).cyan) + pct(zipNew, rawNew) + space(15, diff(zipNew, zipOld)) - ); - - }).then(this.async()).catch(function (error) { - setTimeout(function () { - throw error; - }, 0); - }); - }); - - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-copy'); - grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-jest'); - grunt.loadNpmTasks('grunt-release'); - - grunt.registerTask('lint', 'Lint all source javascript', ['jshint']); - grunt.registerTask('build', 'Build distributed javascript', ['clean', 'bundle', 'copy']); - grunt.registerTask('test', 'Test built javascript', ['jest']); - grunt.registerTask('default', 'Lint, build and test.', ['lint', 'build', 'stats', 'test']); -} diff --git a/LICENSE b/LICENSE index c6a207cd5e..1e3c4f39c0 100644 --- a/LICENSE +++ b/LICENSE @@ -1,30 +1,21 @@ -BSD License +MIT License -For Immutable JS software +Copyright (c) 2014-present, Lee Byron and other contributors. -Copyright (c) 2014-2015, Facebook, Inc. All rights reserved. +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: -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the name Facebook nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/PATENTS b/PATENTS deleted file mode 100644 index b145145264..0000000000 --- a/PATENTS +++ /dev/null @@ -1,11 +0,0 @@ -Additional Grant of Patent Rights Version 2 - -"Software" means the Immutable JS software distributed by Facebook, Inc. - -Facebook, Inc. (“Facebook”) hereby grants to each recipient of the Software (“you”) a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (subject to the termination provision below) license under any Necessary Claims, to make, have made, use, sell, offer to sell, import, and otherwise transfer the Software. For avoidance of doubt, no license is granted under Facebook’s rights in any patent claims that are infringed by (i) modifications to the Software made by you or any third party or (ii) the Software in combination with any software or other technology. - -The license granted hereunder will terminate, automatically and without notice, if you (or any of your subsidiaries, corporate affiliates or agents) initiate directly or indirectly, or take a direct financial interest in, any Patent Assertion: (i) against Facebook or any of its subsidiaries or corporate affiliates, (ii) against any party if such Patent Assertion arises in whole or in part from any software, technology, product or service of Facebook or any of its subsidiaries or corporate affiliates, or (iii) against any party relating to the Software. Notwithstanding the foregoing, if Facebook or any of its subsidiaries or corporate affiliates files a lawsuit alleging patent infringement against you in the first instance, and you respond by filing a patent infringement counterclaim in that lawsuit against that party that is unrelated to the Software, the license granted hereunder will not terminate under section (i) of this paragraph due to such counterclaim. - -A “Necessary Claim” is a claim of a patent owned by Facebook that is necessarily infringed by the Software standing alone. - -A “Patent Assertion” is any lawsuit or other action alleging direct, indirect, or contributory infringement or inducement to infringe any patent, including a cross-claim or counterclaim. diff --git a/README.md b/README.md index 23244d44d9..b9216576fa 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,27 @@ -Immutable collections for JavaScript -==================================== +# Immutable collections for JavaScript -[![Build Status](https://travis-ci.org/facebook/immutable-js.svg)](https://travis-ci.org/facebook/immutable-js) +[![Build Status](https://github.com/immutable-js/immutable-js/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/immutable-js/immutable-js/actions/workflows/ci.yml?query=branch%3Amain) [Chat on slack](https://immutable-js.slack.com) + +[Read the docs](https://immutable-js.com/docs/) and eat your vegetables. + +Docs are automatically generated from [README.md][] and [immutable.d.ts][]. +Please contribute! Also, don't miss the [wiki][] which contains articles on +additional specific topics. Can't find something? Open an [issue][]. + +**Table of contents:** + +- [Introduction](#introduction) +- [Getting started](#getting-started) +- [The case for Immutability](#the-case-for-immutability) +- [JavaScript-first API](#javascript-first-api) +- [Nested Structures](#nested-structures) +- [Equality treats Collections as Values](#equality-treats-collections-as-values) +- [Batching Mutations](#batching-mutations) +- [Lazy Seq](#lazy-seq) +- [Additional Tools and Resources](#additional-tools-and-resources) +- [Contributing](#contributing) + +## Introduction [Immutable][] data cannot be changed once created, leading to much simpler application development, no defensive copying, and enabling advanced memoization @@ -9,102 +29,144 @@ and change detection techniques with simple logic. [Persistent][] data presents a mutative API which does not update the data in-place, but instead always yields new updated data. -`Immutable` provides Persistent Immutable `List`, `Stack`, `Map`, `OrderedMap`, -`Set`, `OrderedSet` and `Record`. They are highly efficient on modern JavaScript -VMs by using structural sharing via [hash maps tries][] and -[vector tries][] as popularized by Clojure and Scala, -minimizing the need to copy or cache data. +Immutable.js provides many Persistent Immutable data structures including: +`List`, `Stack`, `Map`, `OrderedMap`, `Set`, `OrderedSet` and `Record`. -`Immutable` also provides a lazy `Seq`, allowing efficient +These data structures are highly efficient on modern JavaScript VMs by using +structural sharing via [hash maps tries][] and [vector tries][] as popularized +by Clojure and Scala, minimizing the need to copy or cache data. + +Immutable.js also provides a lazy `Seq`, allowing efficient chaining of collection methods like `map` and `filter` without creating intermediate representations. Create some `Seq` with `Range` and `Repeat`. -[Persistent]: http://en.wikipedia.org/wiki/Persistent_data_structure -[Immutable]: http://en.wikipedia.org/wiki/Immutable_object -[hash maps tries]: http://en.wikipedia.org/wiki/Hash_array_mapped_trie -[vector tries]: http://hypirion.com/musings/understanding-persistent-vector-pt-1 +Want to hear more? Watch the presentation about Immutable.js: + +[![Immutable Data and React](website/public/Immutable-Data-and-React-YouTube.png)](https://youtu.be/I7IdS-PbEgI) +[README.md]: https://github.com/immutable-js/immutable-js/blob/main/README.md +[immutable.d.ts]: https://github.com/immutable-js/immutable-js/blob/main/type-definitions/immutable.d.ts +[wiki]: https://github.com/immutable-js/immutable-js/wiki +[issue]: https://github.com/immutable-js/immutable-js/issues +[Persistent]: https://en.wikipedia.org/wiki/Persistent_data_structure +[Immutable]: https://en.wikipedia.org/wiki/Immutable_object +[hash maps tries]: https://en.wikipedia.org/wiki/Hash_array_mapped_trie +[vector tries]: https://hypirion.com/musings/understanding-persistent-vector-pt-1 -Getting started ---------------- +## Getting started Install `immutable` using npm. ```shell +# using npm npm install immutable + +# using Yarn +yarn add immutable + +# using pnpm +pnpm add immutable + +# using Bun +bun add immutable ``` Then require it into any module. -```javascript -var Immutable = require('immutable'); -var map1 = Immutable.Map({a:1, b:2, c:3}); -var map2 = map1.set('b', 50); -map1.get('b'); // 2 -map2.get('b'); // 50 + + +```js +const { Map } = require('immutable'); +const map1 = Map({ a: 1, b: 2, c: 3 }); +const map2 = map1.set('b', 50); +map1.get('b') + ' vs. ' + map2.get('b'); // 2 vs. 50 ``` ### Browser -To use `immutable` from a browser, download [dist/immutable.min.js](./dist/immutable.min.js) -or use a CDN such as [CDNJS](https://cdnjs.com/libraries/immutable) -or [jsDelivr](http://www.jsdelivr.com/#!immutable.js). +Immutable.js has no dependencies, which makes it predictable to include in a Browser. + +It's highly recommended to use a module bundler like [webpack](https://webpack.js.org/), +[rollup](https://rollupjs.org/), or +[browserify](https://browserify.org/). The `immutable` npm module works +without any additional consideration. All examples throughout the documentation +will assume use of this kind of tool. -Then, add it as a script tag to your page: +Alternatively, Immutable.js may be directly included as a script tag. Download +or link to a CDN such as [CDNJS](https://cdnjs.com/libraries/immutable) +or [jsDelivr](https://www.jsdelivr.com/package/npm/immutable). + +Use a script tag to directly add `Immutable` to the global scope: ```html ``` -Or use an AMD loader (such as [RequireJS](http://requirejs.org/)): +Or use an AMD-style loader (such as [RequireJS](https://requirejs.org/)): -```javascript +```js require(['./immutable.min.js'], function (Immutable) { - var map1 = Immutable.Map({a:1, b:2, c:3}); - var map2 = map1.set('b', 50); - map1.get('b'); // 2 - map2.get('b'); // 50 + var map1 = Immutable.Map({ a: 1, b: 2, c: 3 }); + var map2 = map1.set('b', 50); + map1.get('b'); // 2 + map2.get('b'); // 50 }); ``` -If you're using [browserify](http://browserify.org/), the `immutable` npm module -also works from the browser. - -### TypeScript +### Flow & TypeScript Use these Immutable collections and sequences as you would use native -collections in your [TypeScript](http://typescriptlang.org) programs while still taking +collections in your [Flowtype](https://flowtype.org/) or [TypeScript](https://typescriptlang.org) programs while still taking advantage of type generics, error detection, and auto-complete in your IDE. -Just add a reference with a relative path to the type declarations at the top -of your file. +Installing `immutable` via npm brings with it type definitions for Flow (v0.55.0 or higher) +and TypeScript (v4.5 or higher), so you shouldn't need to do anything at all! + +#### Using TypeScript with Immutable.js v4+ + +Immutable.js type definitions embrace ES2015. While Immutable.js itself supports +legacy browsers and environments, its type definitions require TypeScript's 2015 +lib. Include either `"target": "es2015"` or `"lib": "es2015"` in your +`tsconfig.json`, or provide `--target es2015` or `--lib es2015` to the +`tsc` command. + + + +```js +const { Map } = require('immutable'); +const map1 = Map({ a: 1, b: 2, c: 3 }); +const map2 = map1.set('b', 50); +map1.get('b') + ' vs. ' + map2.get('b'); // 2 vs. 50 +``` + +#### Using TypeScript with Immutable.js v3 and earlier: + +Previous versions of Immutable.js include a reference file which you can include +via relative path to the type definitions at the top of your file. -```javascript -/// -import Immutable = require('immutable'); -var map1: Immutable.Map; -map1 = Immutable.Map({a:1, b:2, c:3}); +```js +/// +import { Map } from 'immutable'; +var map1: Map; +map1 = Map({ a: 1, b: 2, c: 3 }); var map2 = map1.set('b', 50); map1.get('b'); // 2 map2.get('b'); // 50 ``` - -The case for Immutability -------------------------- +## The case for Immutability Much of what makes application development difficult is tracking mutation and maintaining state. Developing with immutable data encourages you to think differently about how data flows through your application. -Subscribing to data events throughout your application, by using -`Object.observe`, or any other mechanism, creates a huge overhead of +Subscribing to data events throughout your application creates a huge overhead of book-keeping which can hurt performance, sometimes dramatically, and creates opportunities for areas of your application to get out of sync with each other due to easy to make programmer error. Since immutable data never changes, @@ -116,16 +178,40 @@ and especially well with an application designed using the ideas of [Flux][]. When data is passed from above rather than being subscribed to, and you're only interested in doing work when something has changed, you can use equality. -`Immutable` always returns itself when a mutation results in an identical -collection, allowing for using `===` equality to determine if something -has changed. - -```javascript -var map1 = Immutable.Map({a:1, b:2, c:3}); -var map2 = map1.set('b', 2); -assert(map1 === map2); // no change -var map3 = map1.set('b', 50); -assert(map1 !== map3); // change + +Immutable collections should be treated as _values_ rather than _objects_. While +objects represent some thing which could change over time, a value represents +the state of that thing at a particular instance of time. This principle is most +important to understanding the appropriate use of immutable data. In order to +treat Immutable.js collections as values, it's important to use the +`Immutable.is()` function or `.equals()` method to determine _value equality_ +instead of the `===` operator which determines object _reference identity_. + + + +```js +const { Map } = require('immutable'); +const map1 = Map({ a: 1, b: 2, c: 3 }); +const map2 = Map({ a: 1, b: 2, c: 3 }); +map1.equals(map2); // true +map1 === map2; // false +``` + +Note: As a performance optimization Immutable.js attempts to return the existing +collection when an operation would result in an identical collection, allowing +for using `===` reference equality to determine if something definitely has not +changed. This can be extremely useful when used within a memoization function +which would prefer to re-run the function if a deeper equality check could +potentially be more costly. The `===` equality check is also used internally by +`Immutable.is` and `.equals()` as a performance optimization. + + + +```js +const { Map } = require('immutable'); +const map1 = Map({ a: 1, b: 2, c: 3 }); +const map2 = map1.set('b', 2); // Set to same value +map1 === map2; // true ``` If an object is immutable, it can be "copied" simply by making another reference @@ -133,43 +219,48 @@ to it instead of copying the entire object. Because a reference is much smaller than the object itself, this results in memory savings and a potential boost in execution speed for programs which rely on copies (such as an undo-stack). -```javascript -var map1 = Immutable.Map({a:1, b:2, c:3}); -var clone = map1; + + +```js +const { Map } = require('immutable'); +const map = Map({ a: 1, b: 2, c: 3 }); +const mapCopy = map; // Look, "copies" are free! ``` -[React]: http://facebook.github.io/react/ -[Flux]: http://facebook.github.io/flux/docs/overview.html +[React]: https://reactjs.org/ +[Flux]: https://facebook.github.io/flux/docs/in-depth-overview/ -JavaScript-first API --------------------- +## JavaScript-first API -While `immutable` is inspired by Clojure, Scala, Haskell and other functional +While Immutable.js is inspired by Clojure, Scala, Haskell and other functional programming environments, it's designed to bring these powerful concepts to JavaScript, and therefore has an Object-Oriented API that closely mirrors that -of [ES6][] [Array][], [Map][], and [Set][]. +of [ES2015][] [Array][], [Map][], and [Set][]. -[ES6]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla -[Array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array -[Map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map -[Set]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set +[es2015]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla +[array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array +[map]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map +[set]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set The difference for the immutable collections is that methods which would mutate -the collection, like `push`, `set`, `unshift` or `splice` instead return a new -immutable collection. Methods which return new arrays like `slice` or `concat` +the collection, like `push`, `set`, `unshift` or `splice`, instead return a new +immutable collection. Methods which return new arrays, like `slice` or `concat`, instead return new immutable collections. -```javascript -var list1 = Immutable.List.of(1, 2); -var list2 = list1.push(3, 4, 5); -var list3 = list2.unshift(0); -var list4 = list1.concat(list2, list3); -assert(list1.size === 2); -assert(list2.size === 5); -assert(list3.size === 6); -assert(list4.size === 13); -assert(list4.get(0) === 1); + + +```js +const { List } = require('immutable'); +const list1 = List([1, 2]); +const list2 = list1.push(3, 4, 5); +const list3 = list2.unshift(0); +const list4 = list1.concat(list2, list3); +assert.equal(list1.size, 2); +assert.equal(list2.size, 5); +assert.equal(list3.size, 6); +assert.equal(list4.size, 13); +assert.equal(list4.get(0), 1); ``` Almost all of the methods on [Array][] will be found in similar form on @@ -177,85 +268,144 @@ Almost all of the methods on [Array][] will be found in similar form on found on `Immutable.Set`, including collection operations like `forEach()` and `map()`. -```javascript -var alpha = Immutable.Map({a:1, b:2, c:3, d:4}); + + +```js +const { Map } = require('immutable'); +const alpha = Map({ a: 1, b: 2, c: 3, d: 4 }); alpha.map((v, k) => k.toUpperCase()).join(); // 'A,B,C,D' ``` -### Accepts raw JavaScript objects. +### Convert from raw JavaScript objects and arrays. -Designed to inter-operate with your existing JavaScript, `immutable` -accepts plain JavaScript Arrays and Objects anywhere a method expects an -`Iterable` with no performance penalty. +Designed to inter-operate with your existing JavaScript, Immutable.js +accepts plain JavaScript Arrays and Objects anywhere a method expects a +`Collection`. -```javascript -var map1 = Immutable.Map({a:1, b:2, c:3, d:4}); -var map2 = Immutable.Map({c:10, a:20, t:30}); -var obj = {d:100, o:200, g:300}; -var map3 = map1.merge(map2, obj); + + +```js +const { Map, List } = require('immutable'); +const map1 = Map({ a: 1, b: 2, c: 3, d: 4 }); +const map2 = Map({ c: 10, a: 20, t: 30 }); +const obj = { d: 100, o: 200, g: 300 }; +const map3 = map1.merge(map2, obj); // Map { a: 20, b: 2, c: 10, d: 100, t: 30, o: 200, g: 300 } +const list1 = List([1, 2, 3]); +const list2 = List([4, 5, 6]); +const array = [7, 8, 9]; +const list3 = list1.concat(list2, array); +// List [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] ``` -This is possible because `immutable` can treat any JavaScript Array or Object -as an Iterable. You can take advantage of this in order to get sophisticated +This is possible because Immutable.js can treat any JavaScript Array or Object +as a Collection. You can take advantage of this in order to get sophisticated collection methods on JavaScript Objects, which otherwise have a very sparse native API. Because Seq evaluates lazily and does not cache intermediate results, these operations can be extremely efficient. -```javascript -var myObject = {a:1,b:2,c:3}; -Immutable.Seq(myObject).map(x => x * x).toObject(); + + +```js +const { Seq } = require('immutable'); +const myObject = { a: 1, b: 2, c: 3 }; +Seq(myObject) + .map(x => x * x) + .toObject(); // { a: 1, b: 4, c: 9 } ``` +Keep in mind, when using JS objects to construct Immutable Maps, that +JavaScript Object properties are always strings, even if written in a quote-less +shorthand, while Immutable Maps accept keys of any type. + + + +```js +const { fromJS } = require('immutable'); + +const obj = { 1: 'one' }; +console.log(Object.keys(obj)); // [ "1" ] +console.log(obj['1'], obj[1]); // "one", "one" + +const map = fromJS(obj); +console.log(map.get('1'), map.get(1)); // "one", undefined +``` + +Property access for JavaScript Objects first converts the key to a string, but +since Immutable Map keys can be of any type the argument to `get()` is +not altered. + ### Converts back to raw JavaScript objects. -All `immutable` Iterables can be converted to plain JavaScript Arrays and +All Immutable.js Collections can be converted to plain JavaScript Arrays and Objects shallowly with `toArray()` and `toObject()` or deeply with `toJS()`. -All Immutable Iterables also implement `toJSON()` allowing them to be passed to -`JSON.stringify` directly. - -```javascript -var deep = Immutable.Map({ a: 1, b: 2, c: Immutable.List.of(3, 4, 5) }); -deep.toObject() // { a: 1, b: 2, c: List [ 3, 4, 5 ] } -deep.toArray() // [ 1, 2, List [ 3, 4, 5 ] ] -deep.toJS() // { a: 1, b: 2, c: [ 3, 4, 5 ] } -JSON.stringify(deep) // '{"a":1,"b":2,"c":[3,4,5]}' +All Immutable Collections also implement `toJSON()` allowing them to be passed +to `JSON.stringify` directly. They also respect the custom `toJSON()` methods of +nested objects. + + + +```js +const { Map, List } = require('immutable'); +const deep = Map({ a: 1, b: 2, c: List([3, 4, 5]) }); +console.log(deep.toObject()); // { a: 1, b: 2, c: List [ 3, 4, 5 ] } +console.log(deep.toArray()); // [ 1, 2, List [ 3, 4, 5 ] ] +console.log(deep.toJS()); // { a: 1, b: 2, c: [ 3, 4, 5 ] } +JSON.stringify(deep); // '{"a":1,"b":2,"c":[3,4,5]}' ``` -### Embraces ES6 +### Embraces ES2015 -`Immutable` takes advantage of features added to JavaScript in [ES6][], -the latest standard version of ECMAScript (JavaScript), including [Iterators][], -[Arrow Functions][], [Classes][], and [Modules][]. It's also inspired by the -[Map][] and [Set][] collections added to ES6. The library is "transpiled" to ES3 -in order to support all modern browsers. +Immutable.js supports all JavaScript environments, including legacy +browsers (even IE11). However it also takes advantage of features added to +JavaScript in [ES2015][], the latest standard version of JavaScript, including +[Iterators][], [Arrow Functions][], [Classes][], and [Modules][]. It's inspired +by the native [Map][] and [Set][] collections added to ES2015. -All examples are presented in ES6. To run in all browsers, they need to be -translated to ES3. +All examples in the Documentation are presented in ES2015. To run in all +browsers, they need to be translated to ES5. ```js -// ES6 -foo.map(x => x * x); -// ES3 -foo.map(function (x) { return x * x; }); +// ES2015 +const mapped = foo.map(x => x * x); +// ES5 +var mapped = foo.map(function (x) { + return x * x; +}); ``` +All Immutable.js collections are [Iterable][iterators], which allows them to be +used anywhere an Iterable is expected, such as when spreading into an Array. + + + +```js +const { List } = require('immutable'); +const aList = List([1, 2, 3]); +const anArray = [0, ...aList, 4, 5]; // [ 0, 1, 2, 3, 4, 5 ] +``` + +Note: A Collection is always iterated in the same order, however that order may +not always be well defined, as is the case for the `Map` and `Set`. + [Iterators]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/The_Iterator_protocol [Arrow Functions]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions -[Classes]: http://wiki.ecmascript.org/doku.php?id=strawman:maximally_minimal_classes -[Modules]: http://www.2ality.com/2014/09/es6-modules-final.html +[Classes]: https://wiki.ecmascript.org/doku.php?id=strawman:maximally_minimal_classes +[Modules]: https://www.2ality.com/2014/09/es6-modules-final.html -Nested Structures ------------------ +## Nested Structures -The collections in `immutable` are intended to be nested, allowing for deep +The collections in Immutable.js are intended to be nested, allowing for deep trees of data, similar to JSON. -```javascript -var nested = Immutable.fromJS({a:{b:{c:[3,4,5]}}}); + + +```js +const { fromJS } = require('immutable'); +const nested = fromJS({ a: { b: { c: [3, 4, 5] } } }); // Map { a: Map { b: Map { c: List [ 3, 4, 5 ] } } } ``` @@ -263,93 +413,124 @@ A few power-tools allow for reading and operating on nested data. The most useful are `mergeDeep`, `getIn`, `setIn`, and `updateIn`, found on `List`, `Map` and `OrderedMap`. -```javascript -var nested2 = nested.mergeDeep({a:{b:{d:6}}}); + + +```js +const { fromJS } = require('immutable'); +const nested = fromJS({ a: { b: { c: [3, 4, 5] } } }); + +const nested2 = nested.mergeDeep({ a: { b: { d: 6 } } }); // Map { a: Map { b: Map { c: List [ 3, 4, 5 ], d: 6 } } } -``` -```javascript -nested2.getIn(['a', 'b', 'd']); // 6 +console.log(nested2.getIn(['a', 'b', 'd'])); // 6 -var nested3 = nested2.updateIn(['a', 'b', 'd'], value => value + 1); +const nested3 = nested2.updateIn(['a', 'b', 'd'], value => value + 1); +console.log(nested3); // Map { a: Map { b: Map { c: List [ 3, 4, 5 ], d: 7 } } } -var nested4 = nested3.updateIn(['a', 'b', 'c'], list => list.push(6)); +const nested4 = nested3.updateIn(['a', 'b', 'c'], list => list.push(6)); // Map { a: Map { b: Map { c: List [ 3, 4, 5, 6 ], d: 7 } } } ``` +## Equality treats Collections as Values -Lazy Seq --------- +Immutable.js collections are treated as pure data _values_. Two immutable +collections are considered _value equal_ (via `.equals()` or `is()`) if they +represent the same collection of values. This differs from JavaScript's typical +_reference equal_ (via `===` or `==`) for Objects and Arrays which only +determines if two variables represent references to the same object instance. -`Seq` describes a lazy operation, allowing them to efficiently chain -use of all the Iterable methods (such as `map` and `filter`). +Consider the example below where two identical `Map` instances are not +_reference equal_ but are _value equal_. -**Seq is immutable** — Once a Seq is created, it cannot be -changed, appended to, rearranged or otherwise modified. Instead, any mutative -method called on a Seq will return a new Seq. + -**Seq is lazy** — Seq does as little work as necessary to respond to any -method call. - -For example, the following does not perform any work, because the resulting -Seq is never used: - - var oddSquares = Immutable.Seq.of(1,2,3,4,5,6,7,8) - .filter(x => x % 2).map(x => x * x); - -Once the Seq is used, it performs only the work necessary. In this -example, no intermediate arrays are ever created, filter is called three times, -and map is only called twice: +```js +// First consider: +const obj1 = { a: 1, b: 2, c: 3 }; +const obj2 = { a: 1, b: 2, c: 3 }; +obj1 !== obj2; // two different instances are always not equal with === + +const { Map, is } = require('immutable'); +const map1 = Map({ a: 1, b: 2, c: 3 }); +const map2 = Map({ a: 1, b: 2, c: 3 }); +map1 !== map2; // two different instances are not reference-equal +map1.equals(map2); // but are value-equal if they have the same values +is(map1, map2); // alternatively can use the is() function +``` - console.log(oddSquares.get(1)); // 9 +Value equality allows Immutable.js collections to be used as keys in Maps or +values in Sets, and retrieved with different but equivalent collections: -Any collection can be converted to a lazy Seq with `.toSeq()`. + - var seq = Immutable.Map({a:1, b:1, c:1}).toSeq(); +```js +const { Map, Set } = require('immutable'); +const map1 = Map({ a: 1, b: 2, c: 3 }); +const map2 = Map({ a: 1, b: 2, c: 3 }); +const set = Set().add(map1); +set.has(map2); // true because these are value-equal +``` -Seq allow for the efficient chaining of sequence operations, especially when -converting to a different concrete type (such as to a JS object): +Note: `is()` uses the same measure of equality as [Object.is][] for scalar +strings and numbers, but uses value equality for Immutable collections, +determining if both are immutable and all keys and values are equal +using the same measure of equality. - seq.flip().map(key => key.toUpperCase()).flip().toObject(); - // Map { A: 1, B: 1, C: 1 } +[object.is]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is -As well as expressing logic that would otherwise seem memory-limited: +#### Performance tradeoffs - Immutable.Range(1, Infinity) - .skip(1000) - .map(n => -n) - .filter(n => n % 2 === 0) - .take(2) - .reduce((r, n) => r * n, 1); - // 1006008 +While value equality is useful in many circumstances, it has different +performance characteristics than reference equality. Understanding these +tradeoffs may help you decide which to use in each case, especially when used +to memoize some operation. -Note: An iterable is always iterated in the same order, however that order may -not always be well defined, as is the case for the `Map`. +When comparing two collections, value equality may require considering every +item in each collection, on an `O(N)` time complexity. For large collections of +values, this could become a costly operation. Though if the two are not equal +and hardly similar, the inequality is determined very quickly. In contrast, when +comparing two collections with reference equality, only the initial references +to memory need to be compared which is not based on the size of the collections, +which has an `O(1)` time complexity. Checking reference equality is always very +fast, however just because two collections are not reference-equal does not rule +out the possibility that they may be value-equal. +#### Return self on no-op optimization -Equality treats Collections as Data ------------------------------------ +When possible, Immutable.js avoids creating new objects for updates where no +change in _value_ occurred, to allow for efficient _reference equality_ checking +to quickly determine if no change occurred. -`Immutable` provides equality which treats immutable data structures as pure -data, performing a deep equality check if necessary. + -```javascript -var map1 = Immutable.Map({a:1, b:1, c:1}); -var map2 = Immutable.Map({a:1, b:1, c:1}); -assert(map1 !== map2); -assert(Immutable.is(map1, map2) === true); +```js +const { Map } = require('immutable'); +const originalMap = Map({ a: 1, b: 2, c: 3 }); +const updatedMap = originalMap.set('b', 2); +updatedMap === originalMap; // No-op .set() returned the original reference. ``` -`Immutable.is()` uses the same measure of equality as [Object.is][] -including if both are immutable and all keys and values are equal -using the same measure of equality. +However updates which do result in a change will return a new reference. Each +of these operations occur independently, so two similar updates will not return +the same reference: -[Object.is]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + +```js +const { Map } = require('immutable'); +const originalMap = Map({ a: 1, b: 2, c: 3 }); +const updatedMap = originalMap.set('b', 1000); +// New instance, leaving the original immutable. +updatedMap !== originalMap; +const anotherUpdatedMap = originalMap.set('b', 1000); +// Despite both the results of the same operation, each created a new reference. +anotherUpdatedMap !== updatedMap; +// However the two are value equal. +anotherUpdatedMap.equals(updatedMap); +``` -Batching Mutations ------------------- +## Batching Mutations > If a tree falls in the woods, does it make a sound? > @@ -359,66 +540,222 @@ Batching Mutations > — Rich Hickey, Clojure Applying a mutation to create a new immutable object results in some overhead, -which can add up to a performance penalty. If you need to apply a series of -mutations locally before returning, `Immutable` gives you the ability to create -a temporary mutable (transient) copy of a collection and apply a batch of +which can add up to a minor performance penalty. If you need to apply a series +of mutations locally before returning, Immutable.js gives you the ability to +create a temporary mutable (transient) copy of a collection and apply a batch of mutations in a performant manner by using `withMutations`. In fact, this is -exactly how `Immutable` applies complex mutations itself. +exactly how Immutable.js applies complex mutations itself. As an example, building `list2` results in the creation of 1, not 3, new immutable Lists. -```javascript -var list1 = Immutable.List.of(1,2,3); -var list2 = list1.withMutations(function (list) { + + +```js +const { List } = require('immutable'); +const list1 = List([1, 2, 3]); +const list2 = list1.withMutations(function (list) { list.push(4).push(5).push(6); }); -assert(list1.size === 3); -assert(list2.size === 6); +assert.equal(list1.size, 3); +assert.equal(list2.size, 6); ``` -Note: `immutable` also provides `asMutable` and `asImmutable`, but only +Note: Immutable.js also provides `asMutable` and `asImmutable`, but only encourages their use when `withMutations` will not suffice. Use caution to not return a mutable copy, which could result in undesired behavior. +_Important!_: Only a select few methods can be used in `withMutations` including +`set`, `push` and `pop`. These methods can be applied directly against a +persistent data-structure where other methods like `map`, `filter`, `sort`, +and `splice` will always return new immutable data-structures and never mutate +a mutable collection. -Documentation -------------- +## Lazy Seq -[Read the docs](http://facebook.github.io/immutable-js/docs/) and eat your vegetables. +`Seq` describes a lazy operation, allowing them to efficiently chain +use of all the higher-order collection methods (such as `map` and `filter`) +by not creating intermediate collections. -Docs are automatically generated from [Immutable.d.ts](https://github.com/facebook/immutable-js/blob/master/type-definitions/Immutable.d.ts). -Please contribute! +**Seq is immutable** — Once a Seq is created, it cannot be +changed, appended to, rearranged or otherwise modified. Instead, any mutative +method called on a `Seq` will return a new `Seq`. -Also, don't miss the [Wiki](https://github.com/facebook/immutable-js/wiki) which -contains articles on specific topics. Can't find something? Open an [issue](https://github.com/facebook/immutable-js/issues). +**Seq is lazy** — `Seq` does as little work as necessary to respond to any +method call. Values are often created during iteration, including implicit +iteration when reducing or converting to a concrete data structure such as +a `List` or JavaScript `Array`. +For example, the following performs no work, because the resulting +`Seq`'s values are never iterated: -Contribution ------------- +```js +const { Seq } = require('immutable'); +const oddSquares = Seq([1, 2, 3, 4, 5, 6, 7, 8]) + .filter(x => x % 2 !== 0) + .map(x => x * x); +``` -Use [Github issues](https://github.com/facebook/immutable-js/issues) for requests. +Once the `Seq` is used, it performs only the work necessary. In this +example, no intermediate arrays are ever created, filter is called three +times, and map is only called once: -We actively welcome pull requests, learn how to [contribute](./CONTRIBUTING.md). +```js +oddSquares.get(1); // 9 +``` +Any collection can be converted to a lazy Seq with `Seq()`. -Changelog ---------- + -Changes are tracked as [Github releases](https://github.com/facebook/immutable-js/releases). +```js +const { Map, Seq } = require('immutable'); +const map = Map({ a: 1, b: 2, c: 3 }); +const lazySeq = Seq(map); +``` +`Seq` allows for the efficient chaining of operations, allowing for the +expression of logic that can otherwise be very tedious: -Thanks ------- +```js +lazySeq + .flip() + .map(key => key.toUpperCase()) + .flip(); +// Seq { A: 1, B: 2, C: 3 } +``` -[Phil Bagwell](https://www.youtube.com/watch?v=K2NYwP90bNs), for his inspiration -and research in persistent data structures. +As well as expressing logic that would otherwise seem memory or time +limited, for example `Range` is a special kind of Lazy sequence. -[Hugh Jackson](https://github.com/hughfdjackson/), for providing the npm package -name. If you're looking for his unsupported package, see [v1.4.1](https://www.npmjs.org/package/immutable/1.4.1). + + +```js +const { Range } = require('immutable'); +Range(1, Infinity) + .skip(1000) + .map(n => -n) + .filter(n => n % 2 === 0) + .take(2) + .reduce((r, n) => r * n, 1); +// 1006008 +``` + +## Comparison of filter(), groupBy(), and partition() + +The `filter()`, `groupBy()`, and `partition()` methods are similar in that they +all divide a collection into parts based on applying a function to each element. +All three call the predicate or grouping function once for each item in the +input collection. All three return zero or more collections of the same type as +their input. The returned collections are always distinct from the input +(according to `===`), even if the contents are identical. + +Of these methods, `filter()` is the only one that is lazy and the only one which +discards items from the input collection. It is the simplest to use, and the +fact that it returns exactly one collection makes it easy to combine with other +methods to form a pipeline of operations. + +The `partition()` method is similar to an eager version of `filter()`, but it +returns two collections; the first contains the items that would have been +discarded by `filter()`, and the second contains the items that would have been +kept. It always returns an array of exactly two collections, which can make it +easier to use than `groupBy()`. Compared to making two separate calls to +`filter()`, `partition()` makes half as many calls it the predicate passed to +it. + +The `groupBy()` method is a more generalized version of `partition()` that can +group by an arbitrary function rather than just a predicate. It returns a map +with zero or more entries, where the keys are the values returned by the +grouping function, and the values are nonempty collections of the corresponding +arguments. Although `groupBy()` is more powerful than `partition()`, it can be +harder to use because it is not always possible predict in advance how many +entries the returned map will have and what their keys will be. + +| Summary | `filter` | `partition` | `groupBy` | +|:------------------------------|:---------|:------------|:---------------| +| ease of use | easiest | moderate | hardest | +| generality | least | moderate | most | +| laziness | lazy | eager | eager | +| # of returned sub-collections | 1 | 2 | 0 or more | +| sub-collections may be empty | yes | yes | no | +| can discard items | yes | no | no | +| wrapping container | none | array | Map/OrderedMap | + +## Additional Tools and Resources + +- [Atom-store](https://github.com/jameshopkins/atom-store/) + - A Clojure-inspired atom implementation in Javascript with configurability + for external persistance. + +- [Chai Immutable](https://github.com/astorije/chai-immutable) + - If you are using the [Chai Assertion Library](https://chaijs.com/), this + provides a set of assertions to use against Immutable.js collections. + +- [Fantasy-land](https://github.com/fantasyland/fantasy-land) + - Specification for interoperability of common algebraic structures in JavaScript. + +- [Immutagen](https://github.com/pelotom/immutagen) + - A library for simulating immutable generators in JavaScript. + +- [Immutable-cursor](https://github.com/redbadger/immutable-cursor) + - Immutable cursors incorporating the Immutable.js interface over + Clojure-inspired atom. + +- [Immutable-ext](https://github.com/DrBoolean/immutable-ext) + - Fantasyland extensions for immutablejs + +- [Immutable-js-tools](https://github.com/madeinfree/immutable-js-tools) + - Util tools for immutable.js + +- [Immutable-Redux](https://github.com/gajus/redux-immutable) + - redux-immutable is used to create an equivalent function of Redux + combineReducers that works with Immutable.js state. + +- [Immutable-Treeutils](https://github.com/lukasbuenger/immutable-treeutils) + - Functional tree traversal helpers for ImmutableJS data structures. + +- [Irecord](https://github.com/ericelliott/irecord) + - An immutable store that exposes an RxJS observable. Great for React. +- [Mudash](https://github.com/brianneisler/mudash) + - Lodash wrapper providing Immutable.JS support. -License -------- +- [React-Immutable-PropTypes](https://github.com/HurricaneJames/react-immutable-proptypes) + - PropType validators that work with Immutable.js. -`Immutable` is [BSD-licensed](./LICENSE). We also provide an additional [patent grant](./PATENTS). +- [Redux-Immutablejs](https://github.com/indexiatech/redux-immutablejs) + - Redux Immutable facilities. + +- [Rxstate](https://github.com/yamalight/rxstate) + - Simple opinionated state management library based on RxJS and Immutable.js. + +- [Transit-Immutable-js](https://github.com/glenjamin/transit-immutable-js) + - Transit serialisation for Immutable.js. + - See also: [Transit-js](https://github.com/cognitect/transit-js) + +Have an additional tool designed to work with Immutable.js? +Submit a PR to add it to this list in alphabetical order. + +## Contributing + +Use [Github issues](https://github.com/immutable-js/immutable-js/issues) for requests. + +We actively welcome pull requests, learn how to [contribute](https://github.com/immutable-js/immutable-js/blob/main/.github/CONTRIBUTING.md). + +Immutable.js is maintained within the [Contributor Covenant's Code of Conduct](https://www.contributor-covenant.org/version/2/0/code_of_conduct/). + +### Changelog + +Changes are tracked as [Github releases](https://github.com/immutable-js/immutable-js/releases). + +### License + +Immutable.js is [MIT-licensed](./LICENSE). + +### Thanks + +[Phil Bagwell](https://www.youtube.com/watch?v=K2NYwP90bNs), for his inspiration +and research in persistent data structures. + +[Hugh Jackson](https://github.com/hughfdjackson/), for providing the npm package +name. If you're looking for his unsupported package, see [this repository](https://github.com/hughfdjackson/immutable). diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000..a1fdc82e73 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,17 @@ +# Security Policy + +## Supported Versions + +| Version | Supported | +| ------- | ------------------ | +| 5.1.x | :white_check_mark: | +| 5.0.x | :x: | +| 4.0.x | :white_check_mark: | +| < 4.0 | :x: | + +## Reporting a Vulnerability + +You can send an email to julien@deniau.me to report a security vulnerability. +Please be as specific as possible on how to reproduce and understand the issue. This way, we can fix the issue as fast as possible. + +I will try to reply to you in the following days (it might be sometime longer depending on my personal life). diff --git a/__tests__/ArraySeq.ts b/__tests__/ArraySeq.ts index 8eafe97bc0..1068acb93e 100644 --- a/__tests__/ArraySeq.ts +++ b/__tests__/ArraySeq.ts @@ -1,48 +1,51 @@ -/// -/// -jest.autoMockOff(); - -import Immutable = require('immutable'); +import { describe, expect, it } from '@jest/globals'; +import { Seq } from 'immutable'; describe('ArraySequence', () => { - it('every is true when predicate is true for all entries', () => { - expect(Immutable.Seq([]).every(() => false)).toBe(true); - expect(Immutable.Seq([1,2,3]).every(v => v > 0)).toBe(true); - expect(Immutable.Seq([1,2,3]).every(v => v < 3)).toBe(false); + expect(Seq([]).every(() => false)).toBe(true); + expect(Seq([1, 2, 3]).every((v) => v > 0)).toBe(true); + expect(Seq([1, 2, 3]).every((v) => v < 3)).toBe(false); }); it('some is true when predicate is true for any entry', () => { - expect(Immutable.Seq([]).some(() => true)).toBe(false); - expect(Immutable.Seq([1,2,3]).some(v => v > 0)).toBe(true); - expect(Immutable.Seq([1,2,3]).some(v => v < 3)).toBe(true); - expect(Immutable.Seq([1,2,3]).some(v => v > 1)).toBe(true); - expect(Immutable.Seq([1,2,3]).some(v => v < 0)).toBe(false); + expect(Seq([]).some(() => true)).toBe(false); + expect(Seq([1, 2, 3]).some((v) => v > 0)).toBe(true); + expect(Seq([1, 2, 3]).some((v) => v < 3)).toBe(true); + expect(Seq([1, 2, 3]).some((v) => v > 1)).toBe(true); + expect(Seq([1, 2, 3]).some((v) => v < 0)).toBe(false); }); it('maps', () => { - var i = Immutable.Seq([1,2,3]); - var m = i.map(x => x + x).toObject(); - expect(m).toEqual([2,4,6]); + const i = Seq([1, 2, 3]); + const m = i.map((x) => x + x).toArray(); + expect(m).toEqual([2, 4, 6]); }); it('reduces', () => { - var i = Immutable.Seq([1,2,3]); - var r = i.reduce((r, x) => r + x); + const i = Seq([1, 2, 3]); + const r = i.reduce((acc, x) => acc + x); expect(r).toEqual(6); }); it('efficiently chains iteration methods', () => { - var i = Immutable.Seq('abcdefghijklmnopqrstuvwxyz'.split('')); + const i = Seq('abcdefghijklmnopqrstuvwxyz'.split('')); function studly(letter, index) { return index % 2 === 0 ? letter : letter.toUpperCase(); } - var result = i.reverse().take(10).reverse().take(5).map(studly).toArray().join(''); + const result = i + .reverse() + .take(10) + .reverse() + .take(5) + .map(studly) + .toArray() + .join(''); expect(result).toBe('qRsTu'); }); it('counts from the end of the sequence on negative index', () => { - var i = Immutable.Seq.of(1, 2, 3, 4, 5, 6, 7); + const i = Seq([1, 2, 3, 4, 5, 6, 7]); expect(i.get(-1)).toBe(7); expect(i.get(-5)).toBe(3); expect(i.get(-9)).toBe(undefined); @@ -50,26 +53,26 @@ describe('ArraySequence', () => { }); it('handles trailing holes', () => { - var a = [1,2,3]; + const a = [1, 2, 3]; a.length = 10; - var seq = Immutable.Seq(a); + const seq = Seq(a); expect(seq.size).toBe(10); expect(seq.toArray().length).toBe(10); - expect(seq.map(x => x*x).size).toBe(10); - expect(seq.map(x => x*x).toArray().length).toBe(10); + expect(seq.map((x) => x * x).size).toBe(10); + expect(seq.map((x) => x * x).toArray().length).toBe(10); expect(seq.skip(2).toArray().length).toBe(8); expect(seq.take(2).toArray().length).toBe(2); expect(seq.take(5).toArray().length).toBe(5); - expect(seq.filter(x => x%2==1).toArray().length).toBe(2); + expect(seq.filter((x) => x % 2 === 1).toArray().length).toBe(2); expect(seq.toKeyedSeq().flip().size).toBe(10); expect(seq.toKeyedSeq().flip().flip().size).toBe(10); expect(seq.toKeyedSeq().flip().flip().toArray().length).toBe(10); }); it('can be iterated', () => { - var a = [1,2,3]; - var seq = Immutable.Seq(a); - var entries = seq.entries(); + const a = [1, 2, 3]; + const seq = Seq(a); + const entries = seq.entries(); expect(entries.next()).toEqual({ value: [0, 1], done: false }); expect(entries.next()).toEqual({ value: [1, 2], done: false }); expect(entries.next()).toEqual({ value: [2, 3], done: false }); @@ -77,10 +80,10 @@ describe('ArraySequence', () => { }); it('cannot be mutated after calling toArray', () => { - var seq = Immutable.Seq(['A', 'B', 'C']); + const seq = Seq(['A', 'B', 'C']); - var firstReverse = Immutable.Seq(seq.toArray().reverse()); - var secondReverse = Immutable.Seq(seq.toArray().reverse()); + const firstReverse = Seq(seq.toArray().reverse()); + const secondReverse = Seq(seq.toArray().reverse()); expect(firstReverse.get(0)).toEqual('C'); expect(secondReverse.get(0)).toEqual('C'); diff --git a/__tests__/Comparator.ts b/__tests__/Comparator.ts new file mode 100644 index 0000000000..39ab3679fb --- /dev/null +++ b/__tests__/Comparator.ts @@ -0,0 +1,67 @@ +import { describe, expect, it } from '@jest/globals'; +import { List, OrderedSet, Seq, type Comparator, PairSorting } from 'immutable'; + +const sourceNumbers: readonly number[] = [3, 4, 5, 6, 7, 9, 10, 12, 90, 92, 95]; + +const expectedSortedNumbers: readonly number[] = [ + 7, 95, 90, 92, 3, 5, 9, 4, 6, 10, 12, +]; + +const testComparator: Comparator = (left, right) => { + //The number 7 always goes first... + if (left === 7) { + return PairSorting.LeftThenRight; + } else if (right === 7) { + return PairSorting.RightThenLeft; + } + + //...followed by numbers >= 90, then by all the others. + if (left >= 90 && right < 90) { + return PairSorting.LeftThenRight; + } else if (left < 90 && right >= 90) { + return PairSorting.RightThenLeft; + } + + //Within each group, even numbers go first... + if (left % 2 && !(right % 2)) { + return PairSorting.LeftThenRight; + } else if (!(left % 2) && right % 2) { + return PairSorting.RightThenLeft; + } + + //...and, finally, sort the numbers of each subgroup in ascending order. + return left - right; +}; + +describe.each([ + ['List', List], + ['OrderedSet', OrderedSet], + ['Seq.Indexed', Seq.Indexed], +])('Comparator applied to %s', (_collectionName, testCollectionConstructor) => { + const sourceCollection = testCollectionConstructor(sourceNumbers); + + const expectedSortedCollection = testCollectionConstructor( + expectedSortedNumbers + ); + + describe('when sorting', () => { + it('should support the enum as well as numeric return values', () => { + const actualCollection = sourceCollection.sort(testComparator); + expect(actualCollection).toEqual(expectedSortedCollection); + }); + }); + + describe('when retrieving the max value', () => { + it('should support the enum as well as numeric return values', () => { + const actualMax = sourceCollection.max(testComparator); + expect(actualMax).toBe(12); + }); + }); + + describe('when retrieving the min value', () => { + it('should support the enum as well as numeric return values', () => { + const actualMin = sourceCollection.min(testComparator); + expect(actualMin).toBe(7); + }); + }); +}); diff --git a/__tests__/Conversion.ts b/__tests__/Conversion.ts index c7ce2a6b29..5a008e7e55 100644 --- a/__tests__/Conversion.ts +++ b/__tests__/Conversion.ts @@ -1,150 +1,174 @@ -/// -/// - -jest.autoMockOff(); - -import jasmineCheck = require('jasmine-check'); -jasmineCheck.install(); - -import Immutable = require('immutable'); -import Map = Immutable.Map; -import OrderedMap = Immutable.OrderedMap; -import List = Immutable.List; - -declare function expect(val: any): ExpectWithIs; - -interface ExpectWithIs extends Expect { - is(expected: any): void; - not: ExpectWithIs; -} +import { describe, expect, it } from '@jest/globals'; +import { fromJS, is, List, Map, OrderedMap, Record } from 'immutable'; +import fc, { type JsonValue } from 'fast-check'; describe('Conversion', () => { - - beforeEach(function () { - this.addMatchers({ - is: function(expected) { - return Immutable.is(this.actual, expected); - } - }); - }); - // Note: order of keys based on Map's hashing order - var js = { + const js = { deepList: [ { - position: "first" + position: 'first', }, { - position: "second" + position: 'second', }, { - position: "third" + position: 'third', }, ], deepMap: { - a: "A", - b: "B" + a: 'A', + b: 'B', }, emptyMap: Object.create(null), - point: {x: 10, y: 20}, - string: "Hello", - list: [1, 2, 3] + point: { x: 10, y: 20 }, + string: 'Hello', + list: [1, 2, 3], }; - var Point = Immutable.Record({x:0, y:0}, 'Point'); + const Point = Record({ x: 0, y: 0 }, 'Point'); - var immutableData = Map({ + const immutableData = Map({ deepList: List.of( Map({ - position: "first" + position: 'first', }), Map({ - position: "second" + position: 'second', }), Map({ - position: "third" + position: 'third', }) ), deepMap: Map({ - a: "A", - b: "B" + a: 'A', + b: 'B', }), emptyMap: Map(), - point: Map({x: 10, y: 20}), - string: "Hello", - list: List.of(1, 2, 3) + point: Map({ x: 10, y: 20 }), + string: 'Hello', + list: List.of(1, 2, 3), }); - var immutableOrderedData = OrderedMap({ + const immutableOrderedData = OrderedMap({ deepList: List.of( OrderedMap({ - position: "first" + position: 'first', }), OrderedMap({ - position: "second" + position: 'second', }), OrderedMap({ - position: "third" + position: 'third', }) ), deepMap: OrderedMap({ - a: "A", - b: "B" + a: 'A', + b: 'B', }), emptyMap: OrderedMap(), - point: new Point({x: 10, y: 20}), - string: "Hello", - list: List.of(1, 2, 3) + point: new Point({ x: 10, y: 20 }), + string: 'Hello', + list: List.of(1, 2, 3), }); - var immutableOrderedDataString = 'OrderedMap { ' + - '"deepList": List [ '+ - 'OrderedMap { '+ - '"position": "first"'+ - ' }, ' + - 'OrderedMap { '+ - '"position": "second"'+ - ' }, '+ - 'OrderedMap { '+ - '"position": "third"'+ - ' }' + - ' ], '+ - '"deepMap": OrderedMap { '+ - '"a": "A", '+ - '"b": "B"'+ - ' }, '+ + const immutableOrderedDataString = + 'OrderedMap { ' + + '"deepList": List [ ' + + 'OrderedMap { ' + + '"position": "first"' + + ' }, ' + + 'OrderedMap { ' + + '"position": "second"' + + ' }, ' + + 'OrderedMap { ' + + '"position": "third"' + + ' }' + + ' ], ' + + '"deepMap": OrderedMap { ' + + '"a": "A", ' + + '"b": "B"' + + ' }, ' + '"emptyMap": OrderedMap {}, ' + - '"point": Point { "x": 10, "y": 20 }, '+ - '"string": "Hello", '+ - '"list": List [ 1, 2, 3 ]'+ - ' }'; + '"point": Point { x: 10, y: 20 }, ' + + '"string": "Hello", ' + + '"list": List [ 1, 2, 3 ]' + + ' }'; - var nonStringKeyMap = OrderedMap().set(1, true).set(false, "foo"); - var nonStringKeyMapString = 'OrderedMap { 1: true, false: "foo" }'; + const nonStringKeyMap = OrderedMap().set(1, true).set(false, 'foo'); + const nonStringKeyMapString = 'OrderedMap { 1: true, false: "foo" }'; it('Converts deep JS to deep immutable sequences', () => { - expect(Immutable.fromJS(js)).is(immutableData); + expect(fromJS(js)).toEqual(immutableData); + }); + + it('Throws when provided circular reference', () => { + type OType = { a: { b: { c: OType | null } } }; + + const o: OType = { a: { b: { c: null } } }; + o.a.b.c = o; + expect(() => fromJS(o)).toThrow( + 'Cannot convert circular structure to Immutable' + ); }); it('Converts deep JSON with custom conversion', () => { - var seq = Immutable.fromJS(js, function (key, sequence) { + const seq = fromJS(js, function (key, sequence) { if (key === 'point') { + // @ts-expect-error -- to convert to real typing return new Point(sequence); } - return Array.isArray(this[key]) ? sequence.toList() : sequence.toOrderedMap(); + return Array.isArray(this[key]) + ? sequence.toList() + : sequence.toOrderedMap(); + }); + expect(seq).toEqual(immutableOrderedData); + expect(seq.toString()).toEqual(immutableOrderedDataString); + }); + + it('Converts deep JSON with custom conversion including keypath if requested', () => { + const paths: Array | undefined> = []; + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const seq1 = fromJS(js, function (key, sequence, keypath) { + expect(arguments.length).toBe(3); + paths.push(keypath); + return Array.isArray(this[key]) + ? sequence.toList() + : sequence.toOrderedMap(); + }); + expect(paths).toEqual([ + [], + ['deepList'], + ['deepList', 0], + ['deepList', 1], + ['deepList', 2], + ['deepMap'], + ['emptyMap'], + ['point'], + ['list'], + ]); + + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const seq2 = fromJS(js, function (key, sequence) { + // eslint-disable-next-line prefer-rest-params + expect(arguments[2]).toBe(undefined); }); - expect(seq).is(immutableOrderedData); - expect(seq.toString()).is(immutableOrderedDataString); }); - it('Prints keys as JSON values', () => { - expect(nonStringKeyMap.toString()).is(nonStringKeyMapString); + it('Prints keys as JS values', () => { + expect(nonStringKeyMap.toString()).toEqual(nonStringKeyMapString); + }); + + it('Converts deep sequences to JS', () => { + const js2 = immutableData.toJS(); + expect(is(js2, js)).toBe(false); // raw JS is not immutable. + expect(js2).toEqual(js); // but should be deep equal. }); - it('Converts deep sequences to JSON', () => { - var json = immutableData.toJS(); - expect(json).not.is(js); // raw JS is not immutable. - expect(json).toEqual(js); // but should be deep equal. + it('Converts shallowly to JS', () => { + const js2 = immutableData.toJSON(); + expect(js2).not.toEqual(js); + expect(js2.deepList).toBe(immutableData.get('deepList')); }); it('JSON.stringify() works equivalently on immutable sequences', () => { @@ -152,26 +176,43 @@ describe('Conversion', () => { }); it('JSON.stringify() respects toJSON methods on values', () => { - var Model = Immutable.Record({}); - Model.prototype.toJSON = function() { return 'model'; } - expect( - Immutable.Map({ a: new Model() }).toJS() - ).toEqual({ "a": {} }); - expect( - JSON.stringify(Immutable.Map({ a: new Model() })) - ).toEqual('{"a":"model"}'); + const Model = Record({}); + Model.prototype.toJSON = function () { + return 'model'; + }; + expect(Map({ a: new Model() }).toJS()).toEqual({ a: {} }); + expect(JSON.stringify(Map({ a: new Model() }))).toEqual('{"a":"model"}'); }); it('is conservative with array-likes, only accepting true Arrays.', () => { - expect(Immutable.fromJS({1: 2, length: 3})).is( - Immutable.Map().set('1', 2).set('length', 3) + expect(fromJS({ 1: 2, length: 3 })).toEqual( + Map().set('1', 2).set('length', 3) + ); + expect(fromJS('string')).toEqual('string'); + }); + + it('toJS isomorphic value', () => { + fc.assert( + fc.property(fc.jsonValue(), (v: JsonValue) => { + const imm = fromJS(v); + expect( + // @ts-expect-error Property 'toJS' does not exist on type '{}'.ts(2339) + imm && imm.toJS ? imm.toJS() : imm + ).toEqual(v); + }), + { numRuns: 30 } ); - expect(Immutable.fromJS('string')).toEqual('string'); }); - check.it('toJS isomorphic value', {maxSize: 30}, [gen.JSONValue], (js) => { - var imm = Immutable.fromJS(js); - expect(imm && imm.toJS ? imm.toJS() : imm).toEqual(js); + it('Explicitly convert values to string using String constructor', () => { + expect(() => fromJS({ foo: Symbol('bar') }) + '').not.toThrow(); + expect(() => Map().set('foo', Symbol('bar')) + '').not.toThrow(); + expect(() => Map().set(Symbol('bar'), 'foo') + '').not.toThrow(); }); + it('Converts an immutable value of an entry correctly', () => { + const arr = [{ key: 'a' }]; + const result = fromJS(arr).entrySeq().toJS(); + expect(result).toEqual([[0, { key: 'a' }]]); + }); }); diff --git a/__tests__/Equality.ts b/__tests__/Equality.ts index 0e6110cd69..ae95ef4a12 100644 --- a/__tests__/Equality.ts +++ b/__tests__/Equality.ts @@ -1,26 +1,19 @@ -/// -/// - -jest.autoMockOff(); - -import jasmineCheck = require('jasmine-check'); -jasmineCheck.install(); - -import Immutable = require('immutable'); +import { describe, expect, it } from '@jest/globals'; +import { is, List, Map, Seq, Set } from 'immutable'; +import fc from 'fast-check'; describe('Equality', () => { - function expectIs(left, right) { - var comparison = Immutable.is(left, right); + const comparison = is(left, right); expect(comparison).toBe(true); - var commutative = Immutable.is(right, left); + const commutative = is(right, left); expect(commutative).toBe(true); } function expectIsNot(left, right) { - var comparison = Immutable.is(left, right); + const comparison = is(left, right); expect(comparison).toBe(false); - var commutative = Immutable.is(right, left); + const commutative = is(right, left); expect(commutative).toBe(false); } @@ -38,112 +31,130 @@ describe('Equality', () => { expectIs(NaN, NaN); expectIs(0, 0); expectIs(-0, -0); - // Note: Unlike Object.is, Immutable.is assumes 0 and -0 are the same value, + // Note: Unlike Object.is, is assumes 0 and -0 are the same value, // matching the behavior of ES6 Map key equality. expectIs(0, -0); - expectIs(NaN, 0/0); + expectIs(NaN, 0 / 0); - var string = "hello"; - expectIs(string, string); - expectIs(string, "hello"); - expectIsNot("hello", "HELLO"); - expectIsNot("hello", "goodbye"); + const str = 'hello'; + expectIs(str, str); + expectIs(str, 'hello'); + expectIsNot('hello', 'HELLO'); + expectIsNot('hello', 'goodbye'); - var array = [1,2,3]; + const array = [1, 2, 3]; expectIs(array, array); - expectIsNot(array, [1,2,3]); + expectIsNot(array, [1, 2, 3]); - var object = {key:'value'}; + const object = { key: 'value' }; expectIs(object, object); - expectIsNot(object, {key:'value'}); + expectIsNot(object, { key: 'value' }); }); it('dereferences things', () => { - var ptrA = {foo: 1}, ptrB = {foo: 2}; + const ptrA = { foo: 1 }; + const ptrB = { foo: 2 }; expectIsNot(ptrA, ptrB); - ptrA.valueOf = ptrB.valueOf = function() { + ptrA.valueOf = ptrB.valueOf = function () { return 5; - } + }; expectIs(ptrA, ptrB); - var object = {key:'value'}; - ptrA.valueOf = ptrB.valueOf = function() { + const object = { key: 'value' }; + ptrA.valueOf = ptrB.valueOf = function () { return object; - } + }; expectIs(ptrA, ptrB); - ptrA.valueOf = ptrB.valueOf = function() { - return null; - } + ptrA.valueOf = ptrB.valueOf = function () { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return null as any; + }; expectIs(ptrA, ptrB); - ptrA.valueOf = ptrB.valueOf = function() { - return void 0; - } + ptrA.valueOf = ptrB.valueOf = function () { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return undefined as any; + }; expectIs(ptrA, ptrB); - ptrA.valueOf = function() { + ptrA.valueOf = function () { return 4; - } - ptrB.valueOf = function() { + }; + ptrB.valueOf = function () { return 5; - } + }; expectIsNot(ptrA, ptrB); }); it('compares sequences', () => { - var arraySeq = Immutable.Seq.of(1,2,3); - var arraySeq2 = Immutable.Seq([1,2,3]); + const arraySeq = Seq([1, 2, 3]); + const arraySeq2 = Seq([1, 2, 3]); expectIs(arraySeq, arraySeq); - expectIs(arraySeq, Immutable.Seq.of(1,2,3)); + expectIs(arraySeq, Seq([1, 2, 3])); expectIs(arraySeq2, arraySeq2); - expectIs(arraySeq2, Immutable.Seq([1,2,3])); - expectIsNot(arraySeq, [1,2,3]); - expectIsNot(arraySeq2, [1,2,3]); + expectIs(arraySeq2, Seq([1, 2, 3])); + expectIsNot(arraySeq, [1, 2, 3]); + expectIsNot(arraySeq2, [1, 2, 3]); expectIs(arraySeq, arraySeq2); - expectIs(arraySeq, arraySeq.map(x => x)); - expectIs(arraySeq2, arraySeq2.map(x => x)); + expectIs( + arraySeq, + arraySeq.map((x) => x) + ); + expectIs( + arraySeq2, + arraySeq2.map((x) => x) + ); }); it('compares lists', () => { - var list = Immutable.List.of(1,2,3); + const list = List([1, 2, 3]); expectIs(list, list); - expectIsNot(list, [1,2,3]); + expectIsNot(list, [1, 2, 3]); - expectIs(list, Immutable.Seq.of(1,2,3)); - expectIs(list, Immutable.List.of(1,2,3)); + expectIs(list, Seq([1, 2, 3])); + expectIs(list, List([1, 2, 3])); - var listLonger = list.push(4); + const listLonger = list.push(4); expectIsNot(list, listLonger); - var listShorter = listLonger.pop(); + const listShorter = listLonger.pop(); expect(list === listShorter).toBe(false); expectIs(list, listShorter); }); - var genSimpleVal = gen.returnOneOf(['A', 1]); - - var genVal = gen.oneOf([ - gen.map(Immutable.List, gen.array(genSimpleVal, 0, 4)), - gen.map(Immutable.Set, gen.array(genSimpleVal, 0, 4)), - gen.map(Immutable.Map, gen.array(gen.array(genSimpleVal, 2), 0, 4)) - ]); - - check.it('has symmetric equality', {times: 1000}, [genVal, genVal], (a, b) => { - expect(Immutable.is(a, b)).toBe(Immutable.is(b, a)); + const genSimpleVal = fc.oneof(fc.constant('A'), fc.constant(1)); + + const genVal = fc.oneof( + fc.array(genSimpleVal, { minLength: 0, maxLength: 4 }).map(List), + fc.array(genSimpleVal, { minLength: 0, maxLength: 4 }).map(Set), + fc + .array(fc.array(genSimpleVal, { minLength: 2, maxLength: 2 }), { + minLength: 0, + maxLength: 4, + }) + .map(Map) + ); + + it('has symmetric equality', () => { + fc.assert( + fc.property(genVal, genVal, (a, b) => { + expect(is(a, b)).toBe(is(b, a)); + }), + { numRuns: 1000 } + ); }); - check.it('has hash equality', {times: 1000}, [genVal, genVal], (a, b) => { - if (Immutable.is(a, b)) { - expect(a.hashCode()).toBe(b.hashCode()); - } + it('has hash symmetry', () => { + fc.assert( + fc.property(genVal, genVal, (a, b) => { + if (is(a, b)) { + // eslint-disable-next-line jest/no-conditional-expect + expect(a.hashCode()).toBe(b.hashCode()); + } + }), + { numRuns: 1000 } + ); }); describe('hash', () => { - it('differentiates decimals', () => { - expect( - Immutable.Seq.of(1.5).hashCode() - ).not.toBe( - Immutable.Seq.of(1.6).hashCode() - ); + expect(Seq([1.5]).hashCode()).not.toBe(Seq([1.6]).hashCode()); }); - }); - }); diff --git a/__tests__/IndexedSeq.ts b/__tests__/IndexedSeq.ts index 75af90f6b5..9d33c234e0 100644 --- a/__tests__/IndexedSeq.ts +++ b/__tests__/IndexedSeq.ts @@ -1,34 +1,27 @@ -/// -/// -jest.autoMockOff(); - -import jasmineCheck = require('jasmine-check'); -jasmineCheck.install(); - -import Immutable = require('immutable'); +import { describe, expect, it } from '@jest/globals'; +import { Seq } from 'immutable'; describe('IndexedSequence', () => { - it('maintains skipped offset', () => { - var seq = Immutable.Seq(['A', 'B', 'C', 'D', 'E']); + const seq = Seq(['A', 'B', 'C', 'D', 'E']); // This is what we expect for IndexedSequences - var operated = seq.skip(1); + const operated = seq.skip(1); expect(operated.entrySeq().toArray()).toEqual([ [0, 'B'], [1, 'C'], [2, 'D'], - [3, 'E'] + [3, 'E'], ]); expect(operated.first()).toEqual('B'); }); it('reverses correctly', () => { - var seq = Immutable.Seq(['A', 'B', 'C', 'D', 'E']); + const seq = Seq(['A', 'B', 'C', 'D', 'E']); // This is what we expect for IndexedSequences - var operated = seq.reverse(); + const operated = seq.reverse(); expect(operated.get(0)).toEqual('E'); expect(operated.get(1)).toEqual('D'); expect(operated.get(4)).toEqual('A'); @@ -36,4 +29,21 @@ describe('IndexedSequence', () => { expect(operated.first()).toEqual('E'); expect(operated.last()).toEqual('A'); }); + + it('negative indexes correctly', () => { + const seq = Seq(['A', 'B', 'C', 'D', 'E']); + + expect(seq.first()).toEqual('A'); + expect(seq.last()).toEqual('E'); + expect(seq.get(-0)).toEqual('A'); + expect(seq.get(2)).toEqual('C'); + expect(seq.get(-2)).toEqual('D'); + + const indexes = seq.keySeq(); + expect(indexes.first()).toEqual(0); + expect(indexes.last()).toEqual(4); + expect(indexes.get(-0)).toEqual(0); + expect(indexes.get(2)).toEqual(2); + expect(indexes.get(-2)).toEqual(3); + }); }); diff --git a/__tests__/IterableSeq.ts b/__tests__/IterableSeq.ts deleted file mode 100644 index f90f195bcf..0000000000 --- a/__tests__/IterableSeq.ts +++ /dev/null @@ -1,178 +0,0 @@ -/// -/// -jest.autoMockOff(); - -import Immutable = require('immutable'); - - -describe('IterableSequence', () => { - - it('creates a sequence from an iterable', () => { - var i = new SimpleIterable(); - var s = Immutable.Seq(i); - expect(s.take(5).toArray()).toEqual([ 0,1,2,3,4 ]); - }) - - it('is stable', () => { - var i = new SimpleIterable(); - var s = Immutable.Seq(i); - expect(s.take(5).toArray()).toEqual([ 0,1,2,3,4 ]); - expect(s.take(5).toArray()).toEqual([ 0,1,2,3,4 ]); - expect(s.take(5).toArray()).toEqual([ 0,1,2,3,4 ]); - }) - - it('counts iterations', () => { - var i = new SimpleIterable(10); - var s = Immutable.Seq(i); - expect(s.forEach(x => x)).toEqual(10); - expect(s.take(5).forEach(x => x)).toEqual(5); - expect(s.forEach(x => x < 3)).toEqual(4); - }) - - it('creates a new iterator on every operations', () => { - var mockFn = jest.genMockFunction(); - var i = new SimpleIterable(3, mockFn); - var s = Immutable.Seq(i); - expect(s.toArray()).toEqual([ 0,1,2 ]); - expect(mockFn.mock.calls).toEqual([[0],[1],[2]]); - // The iterator is recreated for the second time. - expect(s.toArray()).toEqual([ 0,1,2 ]); - expect(mockFn.mock.calls).toEqual([[0],[1],[2],[0],[1],[2]]); - }) - - it('can be iterated', () => { - var mockFn = jest.genMockFunction(); - var i = new SimpleIterable(3, mockFn); - var seq = Immutable.Seq(i); - var entries = seq.entries(); - expect(entries.next()).toEqual({ value: [0, 0], done: false }); - // The iteration is lazy - expect(mockFn.mock.calls).toEqual([[0]]); - expect(entries.next()).toEqual({ value: [1, 1], done: false }); - expect(entries.next()).toEqual({ value: [2, 2], done: false }); - expect(entries.next()).toEqual({ value: undefined, done: true }); - expect(mockFn.mock.calls).toEqual([[0],[1],[2]]); - // The iterator is recreated for the second time. - entries = seq.entries(); - expect(entries.next()).toEqual({ value: [0, 0], done: false }); - expect(entries.next()).toEqual({ value: [1, 1], done: false }); - expect(entries.next()).toEqual({ value: [2, 2], done: false }); - expect(entries.next()).toEqual({ value: undefined, done: true }); - expect(mockFn.mock.calls).toEqual([[0],[1],[2],[0],[1],[2]]); - }) - - it('can be mapped and filtered', () => { - var mockFn = jest.genMockFunction(); - var i = new SimpleIterable(undefined, mockFn); // infinite - var seq = Immutable.Seq(i) - .filter(x => x % 2 === 1) - .map(x => x * x); - var entries = seq.entries(); - expect(entries.next()).toEqual({ value: [0, 1], done: false }); - expect(entries.next()).toEqual({ value: [1, 9], done: false }); - expect(entries.next()).toEqual({ value: [2, 25], done: false }); - expect(mockFn.mock.calls).toEqual([[0],[1],[2],[3],[4],[5]]); - }) - - describe('IteratorSequence', () => { - - it('creates a sequence from a raw iterable', () => { - var i = new SimpleIterable(10); - var s = Immutable.Seq(i['@@iterator']()); - expect(s.take(5).toArray()).toEqual([ 0,1,2,3,4 ]); - }) - - it('is stable', () => { - var i = new SimpleIterable(10); - var s = Immutable.Seq(i['@@iterator']()); - expect(s.take(5).toArray()).toEqual([ 0,1,2,3,4 ]); - expect(s.take(5).toArray()).toEqual([ 0,1,2,3,4 ]); - expect(s.take(5).toArray()).toEqual([ 0,1,2,3,4 ]); - }) - - it('counts iterations', () => { - var i = new SimpleIterable(10); - var s = Immutable.Seq(i['@@iterator']()); - expect(s.forEach(x => x)).toEqual(10); - expect(s.take(5).forEach(x => x)).toEqual(5); - expect(s.forEach(x => x < 3)).toEqual(4); - }) - - it('memoizes the iterator', () => { - var mockFn = jest.genMockFunction(); - var i = new SimpleIterable(10, mockFn); - var s = Immutable.Seq(i['@@iterator']()); - expect(s.take(3).toArray()).toEqual([ 0,1,2 ]); - expect(mockFn.mock.calls).toEqual([[0],[1],[2]]); - - // Second call uses memoized values - expect(s.take(3).toArray()).toEqual([ 0,1,2 ]); - expect(mockFn.mock.calls).toEqual([[0],[1],[2]]); - - // Further ahead in the iterator yields more results. - expect(s.take(5).toArray()).toEqual([ 0,1,2,3,4 ]); - expect(mockFn.mock.calls).toEqual([[0],[1],[2],[3],[4]]); - }) - - it('can be iterated', () => { - var mockFn = jest.genMockFunction(); - var i = new SimpleIterable(3, mockFn); - var seq = Immutable.Seq(i['@@iterator']()); - var entries = seq.entries(); - expect(entries.next()).toEqual({ value: [0, 0], done: false }); - // The iteration is lazy - expect(mockFn.mock.calls).toEqual([[0]]); - expect(entries.next()).toEqual({ value: [1, 1], done: false }); - expect(entries.next()).toEqual({ value: [2, 2], done: false }); - expect(entries.next()).toEqual({ value: undefined, done: true }); - expect(mockFn.mock.calls).toEqual([[0],[1],[2]]); - // The iterator has been memoized for the second time. - entries = seq.entries(); - expect(entries.next()).toEqual({ value: [0, 0], done: false }); - expect(entries.next()).toEqual({ value: [1, 1], done: false }); - expect(entries.next()).toEqual({ value: [2, 2], done: false }); - expect(entries.next()).toEqual({ value: undefined, done: true }); - expect(mockFn.mock.calls).toEqual([[0],[1],[2]]); - }) - - it('can iterate an skipped seq based on an iterator', () => { - var i = new SimpleIterable(4); - var seq = Immutable.Seq(i['@@iterator']()); - expect(seq.size).toBe(undefined); - var skipped = seq.skip(2); - expect(skipped.size).toBe(undefined); - var iter = skipped['@@iterator'](); - // The first two were skipped - expect(iter.next()).toEqual({ value: 2, done: false }); - expect(iter.next()).toEqual({ value: 3, done: false }); - expect(iter.next()).toEqual({ value: undefined, done: true }); - }) - }) - -}) - - -// Helper for this test - -function SimpleIterable(max?: number, watcher?: any) { - this.max = max; - this.watcher = watcher; -} -SimpleIterable.prototype['@@iterator'] = function() { - return new SimpleIterator(this); -} - -function SimpleIterator(iterable) { - this.iterable = iterable; - this.value = 0; -} -SimpleIterator.prototype.next = function() { - if (this.value >= this.iterable.max) { - return { value: undefined, done: true }; - } - this.iterable.watcher && this.iterable.watcher(this.value); - return { value: this.value++, done: false }; -} -SimpleIterator.prototype['@@iterator'] = function() { - return this; -} diff --git a/__tests__/KeyedSeq.ts b/__tests__/KeyedSeq.ts index 540a934928..528c28f523 100644 --- a/__tests__/KeyedSeq.ts +++ b/__tests__/KeyedSeq.ts @@ -1,35 +1,34 @@ -/// -/// -jest.autoMockOff(); - -import jasmineCheck = require('jasmine-check'); -jasmineCheck.install(); - -import Immutable = require('immutable'); +import { describe, expect, it } from '@jest/globals'; +import { Range, Seq } from 'immutable'; +import fc from 'fast-check'; describe('KeyedSeq', () => { - - check.it('it iterates equivalently', [gen.array(gen.int)], (ints) => { - var seq = Immutable.Seq(ints); - var keyed = seq.toKeyedSeq(); - - var seqEntries = seq.entries(); - var keyedEntries = keyed.entries(); - - var seqStep, keyedStep; - do { - seqStep = seqEntries.next(); - keyedStep = keyedEntries.next(); - expect(keyedStep).toEqual(seqStep); - } while (!seqStep.done); + it('iterates equivalently', () => { + fc.assert( + fc.property(fc.array(fc.integer()), (ints) => { + const seq = Seq(ints); + const keyed = seq.toKeyedSeq(); + + const seqEntries = seq.entries(); + const keyedEntries = keyed.entries(); + + let seqStep; + let keyedStep; + do { + seqStep = seqEntries.next(); + keyedStep = keyedEntries.next(); + expect(keyedStep).toEqual(seqStep); + } while (!seqStep.done); + }) + ); }); it('maintains keys', () => { - var isEven = x => x % 2 === 0; - var seq = Immutable.Range(0, 100); + const isEven = (x) => x % 2 === 0; + const seq = Range(0, 100); // This is what we expect for IndexedSequences - var operated = seq.filter(isEven).skip(10).take(5); + const operated = seq.filter(isEven).skip(10).take(5); expect(operated.entrySeq().toArray()).toEqual([ [0, 20], [1, 22], @@ -37,10 +36,27 @@ describe('KeyedSeq', () => { [3, 26], [4, 28], ]); + const [indexed0, indexed1] = seq + .partition(isEven) + .map((part) => part.skip(10).take(5)); + expect(indexed0.entrySeq().toArray()).toEqual([ + [0, 21], + [1, 23], + [2, 25], + [3, 27], + [4, 29], + ]); + expect(indexed1.entrySeq().toArray()).toEqual([ + [0, 20], + [1, 22], + [2, 24], + [3, 26], + [4, 28], + ]); // Where Keyed Sequences maintain keys. - var keyed = seq.toKeyedSeq(); - var keyedOperated = keyed.filter(isEven).skip(10).take(5); + const keyed = seq.toKeyedSeq(); + const keyedOperated = keyed.filter(isEven).skip(10).take(5); expect(keyedOperated.entrySeq().toArray()).toEqual([ [20, 20], [22, 22], @@ -48,10 +64,27 @@ describe('KeyedSeq', () => { [26, 26], [28, 28], ]); + const [keyed0, keyed1] = keyed + .partition(isEven) + .map((part) => part.skip(10).take(5)); + expect(keyed0.entrySeq().toArray()).toEqual([ + [21, 21], + [23, 23], + [25, 25], + [27, 27], + [29, 29], + ]); + expect(keyed1.entrySeq().toArray()).toEqual([ + [20, 20], + [22, 22], + [24, 24], + [26, 26], + [28, 28], + ]); }); it('works with reverse', () => { - var seq = Immutable.Range(0, 100); + const seq = Range(0, 100); // This is what we expect for IndexedSequences expect(seq.reverse().take(5).entrySeq().toArray()).toEqual([ @@ -73,10 +106,12 @@ describe('KeyedSeq', () => { }); it('works with double reverse', () => { - var seq = Immutable.Range(0, 100); + const seq = Range(0, 100); // This is what we expect for IndexedSequences - expect(seq.reverse().skip(10).take(5).reverse().entrySeq().toArray()).toEqual([ + expect( + seq.reverse().skip(10).take(5).reverse().entrySeq().toArray() + ).toEqual([ [0, 85], [1, 86], [2, 87], @@ -85,7 +120,9 @@ describe('KeyedSeq', () => { ]); // Where Keyed Sequences maintain keys. - expect(seq.reverse().toKeyedSeq().skip(10).take(5).reverse().entrySeq().toArray()).toEqual([ + expect( + seq.reverse().toKeyedSeq().skip(10).take(5).reverse().entrySeq().toArray() + ).toEqual([ [14, 85], [13, 86], [12, 87], @@ -93,5 +130,4 @@ describe('KeyedSeq', () => { [10, 89], ]); }); - }); diff --git a/__tests__/List.ts b/__tests__/List.ts index e6f407ffb3..da2e9d996b 100644 --- a/__tests__/List.ts +++ b/__tests__/List.ts @@ -1,87 +1,181 @@ -/// -/// - -jest.autoMockOff(); - -import jasmineCheck = require('jasmine-check'); -jasmineCheck.install(); - -import Immutable = require('immutable'); -import List = Immutable.List; - -function arrayOfSize(s) { - var a = new Array(s); - for (var ii = 0; ii < s; ii++) { +import { describe, expect, it } from '@jest/globals'; +import { fromJS, List, Map, Range, Seq, Set } from 'immutable'; +import fc from 'fast-check'; +import { create as createSeed } from 'random-seed'; + +function arrayOfSize(s: number) { + const a = new Array(s); + for (let ii = 0; ii < s; ii++) { a[ii] = ii; } return a; } describe('List', () => { + it('determines assignment of unspecified value types', () => { + interface Test { + list: List; + } + + const t: Test = { + list: List(), + }; + + expect(t.list.size).toBe(0); + }); it('of provides initial values', () => { - var v = List.of('a', 'b', 'c'); + const v = List.of('a', 'b', 'c'); expect(v.get(0)).toBe('a'); expect(v.get(1)).toBe('b'); expect(v.get(2)).toBe('c'); }); it('toArray provides a JS array', () => { - var v = List.of('a', 'b', 'c'); + const v = List.of('a', 'b', 'c'); expect(v.toArray()).toEqual(['a', 'b', 'c']); }); it('does not accept a scalar', () => { expect(() => { - Immutable.List(3); - }).toThrow('Expected Array or iterable object of values: 3'); + // @ts-expect-error -- test that runtime does throw + List(3); + }).toThrow('Expected Array or collection object of values: 3'); }); it('accepts an array', () => { - var v = List(['a', 'b', 'c']); + const v = List(['a', 'b', 'c']); expect(v.get(1)).toBe('b'); expect(v.toArray()).toEqual(['a', 'b', 'c']); }); it('accepts an array-like', () => { - var v = List({ 'length': 3, '1': 'b' }); - expect(v.get(1)).toBe('b'); - expect(v.toArray()).toEqual([undefined, 'b', undefined]); + const v = List({ length: 3, 2: 'c' }); + expect(v.get(2)).toBe('c'); + expect(v.toArray()).toEqual([undefined, undefined, 'c']); }); - it('accepts any array-like iterable, including strings', () => { - var v = List('abc'); + it('accepts any array-like collection, including strings', () => { + const v = List('abc'); expect(v.get(1)).toBe('b'); expect(v.toArray()).toEqual(['a', 'b', 'c']); }); it('accepts an indexed Seq', () => { - var seq = Immutable.Seq(['a', 'b', 'c']); - var v = List(seq); + const seq = Seq(['a', 'b', 'c']); + const v = List(seq); expect(v.toArray()).toEqual(['a', 'b', 'c']); }); it('accepts a keyed Seq as a list of entries', () => { - var seq = Immutable.Seq({a:null, b:null, c:null}).flip(); - var v = List(seq); - expect(v.toArray()).toEqual([[null,'a'], [null,'b'], [null,'c']]); + const seq = Seq({ a: null, b: null, c: null }).flip(); + const v = List(seq); + expect(v.toArray()).toEqual([ + [null, 'a'], + [null, 'b'], + [null, 'c'], + ]); // Explicitly getting the values sequence - var v2 = List(seq.valueSeq()); - expect(v2.toArray()).toEqual(['a','b','c']); + const v2 = List(seq.valueSeq()); + expect(v2.toArray()).toEqual(['a', 'b', 'c']); // toList() does this for you. - var v3 = seq.toList(); + const v3 = seq.toList(); expect(v3.toArray()).toEqual(['a', 'b', 'c']); }); it('can set and get a value', () => { - var v = List(); + let v = List(); expect(v.get(0)).toBe(undefined); v = v.set(0, 'value'); expect(v.get(0)).toBe('value'); }); + it('can setIn and getIn a deep value', () => { + let v = List([ + Map({ + aKey: List(['bad', 'good']), + }), + ]); + expect(v.getIn([0, 'aKey', 1])).toBe('good'); + v = v.setIn([0, 'aKey', 1], 'great'); + expect(v.getIn([0, 'aKey', 1])).toBe('great'); + }); + + it('can setIn on an inexistant index', () => { + const myMap = Map<{ a: Array; b: Array; c?: List }>( + { a: [], b: [] } + ); + const out = myMap.setIn(['a', 0], 'v').setIn(['c', 0], 'v'); + + expect(out.getIn(['a', 0])).toEqual('v'); + expect(out.getIn(['c', 0])).toEqual('v'); + expect(out.get('a')).toBeInstanceOf(Array); + expect(out.get('b')).toBeInstanceOf(Array); + expect(out.get('c')).toBeInstanceOf(Map); + expect(out.get('c')?.keySeq().first()).toBe(0); + }); + + it('throw when calling setIn on a non data structure', () => { + const avengers = [ + 'ironMan', // index [0] + [ + 'captainAmerica', // index [1][0] + [ + 'blackWidow', // index [1][1][0] + ['theHulk'], // index [1][1][1][0] + ], + ], + ]; + + const avengersList = fromJS(avengers) as List; + + // change theHulk to scarletWitch + const out1 = avengersList.setIn([1, 1, 1, 0], 'scarletWitch'); + expect(out1.getIn([1, 1, 1, 0])).toEqual('scarletWitch'); + + const out2 = avengersList.setIn([1, 1, 1, 3], 'scarletWitch'); + expect(out2.getIn([1, 1, 1, 3])).toEqual('scarletWitch'); + + expect(() => { + avengersList.setIn([0, 1], 'scarletWitch'); + }).toThrow( + 'Cannot update within non-data-structure value in path [0]: ironMan' + ); + }); + + it('can update a value', () => { + const l = List.of(5); + // @ts-expect-error -- Type definition limitation + expect(l.update(0, (v) => v * v).toArray()).toEqual([25]); + }); + + it('can updateIn a deep value', () => { + let l = List([ + Map({ + aKey: List(['bad', 'good']), + }), + ]); + // @ts-expect-error -- Type definition limitation + l = l.updateIn([0, 'aKey', 1], (v) => v + v); + expect(l.toJS()).toEqual([ + { + aKey: ['bad', 'goodgood'], + }, + ]); + }); + + it('returns undefined when getting a null value', () => { + const v = List([1, 2, 3]); + // @ts-expect-error -- test runtime + expect(v.get(null)).toBe(undefined); + + const o = List([{ a: 1 }, { b: 2 }, { c: 3 }]); + // @ts-expect-error -- test runtime + expect(o.get(null)).toBe(undefined); + }); + it('counts from the end of the list on negative index', () => { - var i = Immutable.List.of(1, 2, 3, 4, 5, 6, 7); + const i = List.of(1, 2, 3, 4, 5, 6, 7); expect(i.get(-1)).toBe(7); expect(i.get(-5)).toBe(3); expect(i.get(-9)).toBe(undefined); @@ -90,24 +184,78 @@ describe('List', () => { it('coerces numeric-string keys', () => { // Of course, TypeScript protects us from this, so cast to "any" to test. - var i: any = Immutable.List.of(1, 2, 3, 4, 5, 6); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const i: any = List.of(1, 2, 3, 4, 5, 6); expect(i.get('1')).toBe(2); - expect(i.get('-1')).toBe(6); - expect(i.set('3', 10).get('-3')).toBe(10); + expect(i.set('3', 10).get('3')).toBe(10); + // Like array, string negative numbers do not qualify + expect(i.get('-1')).toBe(undefined); + // Like array, string floating point numbers do not qualify + expect(i.get('1.0')).toBe(undefined); + }); + + it('uses not set value for string index', () => { + const list = List(); + // @ts-expect-error -- test runtime + expect(list.get('stringKey', 'NOT-SET')).toBe('NOT-SET'); + }); + + it('uses not set value for index {}', () => { + const list = List.of(1, 2, 3, 4, 5); + // @ts-expect-error -- test runtime + expect(list.get({}, 'NOT-SET')).toBe('NOT-SET'); + }); + + it('uses not set value for index void 0', () => { + const list = List.of(1, 2, 3, 4, 5); + // @ts-expect-error -- test runtime + + expect(list.get(void 0, 'NOT-SET')).toBe('NOT-SET'); + }); + + it('uses not set value for index undefined', () => { + const list = List.of(1, 2, 3, 4, 5); + // @ts-expect-error -- test runtime + expect(list.get(undefined, 'NOT-SET')).toBe('NOT-SET'); + }); + + it('doesnt coerce empty strings to index 0', () => { + const list = List.of(1, 2, 3); + // @ts-expect-error -- test runtime + expect(list.has('')).toBe(false); + }); + + it('doesnt contain elements at non-empty string keys', () => { + const list = List.of(1, 2, 3, 4, 5); + // @ts-expect-error -- test runtime + expect(list.has('str')).toBe(false); + }); + + it('hasIn doesnt contain elements at non-empty string keys', () => { + const list = List.of(1, 2, 3, 4, 5); + expect(list.hasIn(['str'])).toBe(false); + }); + + it('hasIn doesnt throw for bad key-path', () => { + const list = List.of(1, 2, 3, 4, 5); + expect(list.hasIn([1, 2, 3])).toBe(false); + + const list2 = List([{}]); + expect(list2.hasIn([0, 'bad'])).toBe(false); }); it('setting creates a new instance', () => { - var v0 = List.of('a'); - var v1 = v0.set(0, 'A'); + const v0 = List.of('a'); + const v1 = v0.set(0, 'A'); expect(v0.get(0)).toBe('a'); expect(v1.get(0)).toBe('A'); }); it('size includes the highest index', () => { - var v0 = List(); - var v1 = v0.set(0, 'a'); - var v2 = v1.set(1, 'b'); - var v3 = v2.set(2, 'c'); + const v0 = List(); + const v1 = v0.set(0, 'a'); + const v2 = v1.set(1, 'b'); + const v3 = v2.set(2, 'c'); expect(v0.size).toBe(0); expect(v1.size).toBe(1); expect(v2.size).toBe(2); @@ -115,17 +263,17 @@ describe('List', () => { }); it('get helpers make for easier to read code', () => { - var v = List.of('a', 'b', 'c'); + const v = List.of('a', 'b', 'c'); expect(v.first()).toBe('a'); expect(v.get(1)).toBe('b'); expect(v.last()).toBe('c'); }); it('slice helpers make for easier to read code', () => { - var v0 = List.of('a', 'b', 'c'); - var v1 = List.of('a', 'b'); - var v2 = List.of('a'); - var v3 = List(); + const v0 = List.of('a', 'b', 'c'); + const v1 = List.of('a', 'b'); + const v2 = List.of('a'); + const v3 = List(); expect(v0.rest().toArray()).toEqual(['b', 'c']); expect(v0.butLast().toArray()).toEqual(['a', 'b']); @@ -141,16 +289,16 @@ describe('List', () => { }); it('can set at arbitrary indices', () => { - var v0 = List.of('a', 'b', 'c'); - var v1 = v0.set(1, 'B'); // within existing tail - var v2 = v1.set(3, 'd'); // at last position - var v3 = v2.set(31, 'e'); // (testing internal guts) - var v4 = v3.set(32, 'f'); // (testing internal guts) - var v5 = v4.set(1023, 'g'); // (testing internal guts) - var v6 = v5.set(1024, 'h'); // (testing internal guts) - var v7 = v6.set(32, 'F'); // set within existing tree + const v0 = List.of('a', 'b', 'c'); + const v1 = v0.set(1, 'B'); // within existing tail + const v2 = v1.set(3, 'd'); // at last position + const v3 = v2.set(31, 'e'); // (testing internal guts) + const v4 = v3.set(32, 'f'); // (testing internal guts) + const v5 = v4.set(1023, 'g'); // (testing internal guts) + const v6 = v5.set(1024, 'h'); // (testing internal guts) + const v7 = v6.set(32, 'F'); // set within existing tree expect(v7.size).toBe(1025); - var expectedArray = ['a', 'B', 'c', 'd']; + const expectedArray = ['a', 'B', 'c', 'd']; expectedArray[31] = 'e'; expectedArray[32] = 'F'; expectedArray[1023] = 'g'; @@ -159,43 +307,52 @@ describe('List', () => { }); it('can contain a large number of indices', () => { - var v = Immutable.Range(0,20000).toList(); - var iterations = 0; - v.forEach(v => { + const r = Range(0, 20000).toList(); + let iterations = 0; + r.forEach((v) => { expect(v).toBe(iterations); iterations++; }); - }) + }); it('describes a dense list', () => { - var v = List.of('a', 'b', 'c').push('d').set(14, 'o').set(6, undefined).remove(1); + const v = List.of('a', 'b', 'c') + .push('d') + .set(14, 'o') + .set(6, undefined) + .remove(1); expect(v.size).toBe(14); - expect(v.toJS()).toEqual( - ['a','c','d',,,,,,,,,,,'o'] - ); + // eslint-disable-next-line no-sparse-arrays + expect(v.toJS()).toEqual(['a', 'c', 'd', , , , , , , , , , , 'o']); }); it('iterates a dense list', () => { - var v = List().setSize(11).set(1,1).set(3,3).set(5,5).set(7,7).set(9,9); + const v = List() + .setSize(11) + .set(1, 1) + .set(3, 3) + .set(5, 5) + .set(7, 7) + .set(9, 9); expect(v.size).toBe(11); - var forEachResults = []; + const forEachResults: Array<[number, undefined | number]> = []; v.forEach((val, i) => forEachResults.push([i, val])); expect(forEachResults).toEqual([ - [0,undefined], - [1,1], - [2,undefined], - [3,3], - [4,undefined], - [5,5], - [6,undefined], - [7,7], - [8,undefined], - [9,9], - [10,undefined], + [0, undefined], + [1, 1], + [2, undefined], + [3, 3], + [4, undefined], + [5, 5], + [6, undefined], + [7, 7], + [8, undefined], + [9, 9], + [10, undefined], ]); - var arrayResults = v.toArray(); + const arrayResults = v.toArray(); expect(arrayResults).toEqual([ undefined, 1, @@ -210,55 +367,62 @@ describe('List', () => { undefined, ]); - var iteratorResults = []; - var iterator = v.entries(); - var step; + const iteratorResults: Array<[number, undefined | number]> = []; + const iterator = v.entries(); + let step; while (!(step = iterator.next()).done) { iteratorResults.push(step.value); } expect(iteratorResults).toEqual([ - [0,undefined], - [1,1], - [2,undefined], - [3,3], - [4,undefined], - [5,5], - [6,undefined], - [7,7], - [8,undefined], - [9,9], - [10,undefined], + [0, undefined], + [1, 1], + [2, undefined], + [3, 3], + [4, undefined], + [5, 5], + [6, undefined], + [7, 7], + [8, undefined], + [9, 9], + [10, undefined], ]); }); + it('has the same iterator function for values', () => { + const l = List(['a', 'b', 'c']); + expect(l[Symbol.iterator]).toBe(l.values); + }); + it('push inserts at highest index', () => { - var v0 = List.of('a', 'b', 'c'); - var v1 = v0.push('d', 'e', 'f'); + const v0 = List.of('a', 'b', 'c'); + const v1 = v0.push('d', 'e', 'f'); expect(v0.size).toBe(3); expect(v1.size).toBe(6); expect(v1.toArray()).toEqual(['a', 'b', 'c', 'd', 'e', 'f']); }); - check.it('pushes multiple values to the end', {maxSize: 2000}, - [gen.posInt, gen.posInt], (s1, s2) => { - var a1 = arrayOfSize(s1); - var a2 = arrayOfSize(s2); + it('pushes multiple values to the end', () => { + fc.assert( + fc.property(fc.nat(100), fc.nat(100), (s1, s2) => { + const a1 = arrayOfSize(s1); + const a2 = arrayOfSize(s2); - var v1 = List(a1); - var v3 = v1.push.apply(v1, a2); + const v1 = List(a1); + const v3 = v1.push.apply(v1, a2); - var a3 = a1.slice(); - a3.push.apply(a3, a2); + const a3 = a1.slice(); + a3.push.apply(a3, a2); - expect(v3.size).toEqual(a3.length); - expect(v3.toArray()).toEqual(a3); - } - ); + expect(v3.size).toEqual(a3.length); + expect(v3.toArray()).toEqual(a3); + }) + ); + }); it('pop removes the highest index, decrementing size', () => { - var v = List.of('a', 'b', 'c').pop(); + let v = List.of('a', 'b', 'c').pop(); expect(v.last()).toBe('b'); - expect(v.toArray()).toEqual(['a','b']); + expect(v.toArray()).toEqual(['a', 'b']); v = v.set(1230, 'x'); expect(v.size).toBe(1231); expect(v.last()).toBe('x'); @@ -270,40 +434,44 @@ describe('List', () => { expect(v.last()).toBe('X'); }); - check.it('pop removes the highest index, just like array', {maxSize: 2000}, - [gen.posInt], len => { - var a = arrayOfSize(len); - var v = List(a); - - while (a.length) { + it('pop removes the highest index, just like array', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const a = arrayOfSize(len); + let v = List(a); + + while (a.length) { + expect(v.size).toBe(a.length); + expect(v.toArray()).toEqual(a); + v = v.pop(); + a.pop(); + } expect(v.size).toBe(a.length); expect(v.toArray()).toEqual(a); - v = v.pop(); - a.pop(); - } - expect(v.size).toBe(a.length); - expect(v.toArray()).toEqual(a); - } - ); - - check.it('push adds the next highest index, just like array', {maxSize: 2000}, - [gen.posInt], len => { - var a = []; - var v = List(); + }) + ); + }); - for (var ii = 0; ii < len; ii++) { + it('push adds the next highest index, just like array', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const a: Array = []; + let v = List(); + + for (let ii = 0; ii < len; ii++) { + expect(v.size).toBe(a.length); + expect(v.toArray()).toEqual(a); + v = v.push(ii); + a.push(ii); + } expect(v.size).toBe(a.length); expect(v.toArray()).toEqual(a); - v = v.push(ii); - a.push(ii); - } - expect(v.size).toBe(a.length); - expect(v.toArray()).toEqual(a); - } - ); + }) + ); + }); it('allows popping an empty list', () => { - var v = List.of('a').pop(); + let v = List.of('a').pop(); expect(v.size).toBe(0); expect(v.toArray()).toEqual([]); v = v.pop().pop().pop().pop().pop(); @@ -311,8 +479,8 @@ describe('List', () => { expect(v.toArray()).toEqual([]); }); - it('remove removes any index', () => { - var v = List.of('a', 'b', 'c').remove(2).remove(0); + it.each(['remove', 'delete'])('remove removes any index', (fn) => { + let v = List.of('a', 'b', 'c')[fn](2)[fn](0); expect(v.size).toBe(1); expect(v.get(0)).toBe('b'); expect(v.get(1)).toBe(undefined); @@ -321,94 +489,189 @@ describe('List', () => { v = v.push('d'); expect(v.size).toBe(2); expect(v.get(1)).toBe('d'); - expect(v.toArray()).toEqual(['b','d']); + expect(v.toArray()).toEqual(['b', 'd']); }); it('shifts values from the front', () => { - var v = List.of('a', 'b', 'c').shift(); + const v = List.of('a', 'b', 'c').shift(); expect(v.first()).toBe('b'); expect(v.size).toBe(2); }); it('unshifts values to the front', () => { - var v = List.of('a', 'b', 'c').unshift('x', 'y', 'z'); + const v = List.of('a', 'b', 'c').unshift('x', 'y', 'z'); expect(v.first()).toBe('x'); expect(v.size).toBe(6); expect(v.toArray()).toEqual(['x', 'y', 'z', 'a', 'b', 'c']); }); - check.it('unshifts multiple values to the front', {maxSize: 2000}, - [gen.posInt, gen.posInt], (s1, s2) => { - var a1 = arrayOfSize(s1); - var a2 = arrayOfSize(s2); + it('unshifts multiple values to the front', () => { + fc.assert( + fc.property(fc.nat(100), fc.nat(100), (s1, s2) => { + const a1 = arrayOfSize(s1); + const a2 = arrayOfSize(s2); - var v1 = List(a1); - var v3 = v1.unshift.apply(v1, a2); + const v1 = List(a1); + const v3 = v1.unshift.apply(v1, a2); - var a3 = a1.slice(); - a3.unshift.apply(a3, a2); + const a3 = a1.slice(); + a3.unshift.apply(a3, a2); - expect(v3.size).toEqual(a3.length); - expect(v3.toArray()).toEqual(a3); - } - ); + expect(v3.size).toEqual(a3.length); + expect(v3.toArray()).toEqual(a3); + }) + ); + }); it('finds values using indexOf', () => { - var v = List.of('a', 'b', 'c', 'b', 'a'); + const v = List.of('a', 'b', 'c', 'b', 'a'); expect(v.indexOf('b')).toBe(1); expect(v.indexOf('c')).toBe(2); expect(v.indexOf('d')).toBe(-1); }); + it('finds values using lastIndexOf', () => { + const v = List.of('a', 'b', 'c', 'b', 'a'); + expect(v.lastIndexOf('b')).toBe(3); + expect(v.lastIndexOf('c')).toBe(2); + expect(v.lastIndexOf('d')).toBe(-1); + }); + it('finds values using findIndex', () => { - var v = List.of('a', 'b', 'c', 'B', 'a'); - expect(v.findIndex(value => value.toUpperCase() === value)).toBe(3); - expect(v.findIndex(value => value.length > 1)).toBe(-1); + const v = List.of('a', 'b', 'c', 'B', 'a'); + expect(v.findIndex((value) => value.toUpperCase() === value)).toBe(3); + expect(v.findIndex((value) => value.length > 1)).toBe(-1); }); it('finds values using findEntry', () => { - var v = List.of('a', 'b', 'c', 'B', 'a'); - expect(v.findEntry(value => value.toUpperCase() === value)).toEqual([3, 'B']); - expect(v.findEntry(value => value.length > 1)).toBe(undefined); + const v = List.of('a', 'b', 'c', 'B', 'a'); + expect(v.findEntry((value) => value.toUpperCase() === value)).toEqual([ + 3, + 'B', + ]); + expect(v.findEntry((value) => value.length > 1)).toBe(undefined); }); it('maps values', () => { - var v = List.of('a', 'b', 'c'); - var r = v.map(value => value.toUpperCase()); + const v = List.of('a', 'b', 'c'); + const r = v.map((value) => value.toUpperCase()); expect(r.toArray()).toEqual(['A', 'B', 'C']); }); + it('map no-ops return the same reference', () => { + const v = List.of('a', 'b', 'c'); + const r = v.map((value) => value); + expect(r).toBe(v); + }); + + it('ensures iter is unmodified', () => { + const v = List.of(1, 2, 3); + const r = v.map((value, index, iter) => iter.get(index - 1)); + expect(r.toArray()).toEqual([3, 1, 2]); + }); + it('filters values', () => { - var v = List.of('a', 'b', 'c', 'd', 'e', 'f'); - var r = v.filter((value, index) => index % 2 === 1); + const v = List.of('a', 'b', 'c', 'd', 'e', 'f'); + const r = v.filter((value, index) => index % 2 === 1); expect(r.toArray()).toEqual(['b', 'd', 'f']); }); + it('partitions values', () => { + const v = List.of('a', 'b', 'c', 'd', 'e', 'f'); + const r = v + .partition((value, index) => index % 2 === 1) + .map((part) => part.toArray()); + expect(r).toEqual([ + ['a', 'c', 'e'], + ['b', 'd', 'f'], + ]); + }); + + it('filters values based on type', () => { + class A {} + class B extends A { + b(): void {} + } + class C extends A { + c(): void {} + } + const l1 = List([new B(), new C(), new B(), new C()]); + const l2: List = l1.filter((v): v is C => v instanceof C); + expect(l2.size).toEqual(2); + expect(l2.every((v) => v instanceof C)).toBe(true); + }); + + it('partitions values based on type', () => { + class A {} + class B extends A { + b(): void {} + } + class C extends A { + c(): void {} + } + const l1 = List([new B(), new C(), new B(), new C()]); + const [la, lc]: [List, List] = l1.partition( + (v): v is C => v instanceof C + ); + expect(la.size).toEqual(2); + expect(la.some((v) => v instanceof C)).toBe(false); + expect(lc.size).toEqual(2); + expect(lc.every((v) => v instanceof C)).toBe(true); + }); + it('reduces values', () => { - var v = List.of(1,10,100); - var r = v.reduce((reduction, value) => reduction + value); + const v = List.of(1, 10, 100); + const r = v.reduce((reduction, value) => reduction + value); expect(r).toEqual(111); + const r2 = v.reduce((reduction, value) => reduction + value, 1000); + expect(r2).toEqual(1111); }); it('reduces from the right', () => { - var v = List.of('a','b','c'); - var r = v.reduceRight((reduction, value) => reduction + value); + const v = List.of('a', 'b', 'c'); + const r = v.reduceRight((reduction, value) => reduction + value); expect(r).toEqual('cba'); + const r2 = v.reduceRight((reduction, value) => reduction + value, 'x'); + expect(r2).toEqual('xcba'); + }); + + it('takes maximum number', () => { + const v = List.of('a', 'b', 'c'); + const r = v.take(Number.MAX_SAFE_INTEGER); + expect(r).toBe(v); }); it('takes and skips values', () => { - var v = List.of('a', 'b', 'c', 'd', 'e', 'f'); - var r = v.skip(2).take(2); + const v = List.of('a', 'b', 'c', 'd', 'e', 'f'); + const r = v.skip(2).take(2); expect(r.toArray()).toEqual(['c', 'd']); }); + it('takes and skips no-ops return same reference', () => { + const v = List.of('a', 'b', 'c', 'd', 'e', 'f'); + const r = v.skip(0).take(6); + expect(r).toBe(v); + }); + + it('takeLast and skipLast values', () => { + const v = List.of('a', 'b', 'c', 'd', 'e', 'f'); + const r = v.skipLast(1).takeLast(2); + expect(r.toArray()).toEqual(['d', 'e']); + }); + + it('takeLast and skipLast no-ops return same reference', () => { + const v = List.of('a', 'b', 'c', 'd', 'e', 'f'); + const r = v.skipLast(0).takeLast(6); + expect(r).toBe(v); + }); + it('efficiently chains array methods', () => { - var v = List.of(1,2,3,4,5,6,7,8,9,10,11,12,13,14); + const v = List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14); - var r = v - .filter(x => x % 2 == 0) + const r = v + .filter((x) => x % 2 === 0) .skip(2) - .map(x => x * x) + .map((x) => x * x) .take(3) .reduce((a: number, b: number) => a + b, 0); @@ -416,66 +679,206 @@ describe('List', () => { }); it('can convert to a map', () => { - var v = List.of('a', 'b', 'c'); - var m = v.toMap(); + const v = List.of('a', 'b', 'c'); + const m = v.toMap(); expect(m.size).toBe(3); expect(m.get(1)).toBe('b'); }); it('reverses', () => { - var v = List.of('a', 'b', 'c'); + const v = List.of('a', 'b', 'c'); expect(v.reverse().toArray()).toEqual(['c', 'b', 'a']); }); it('ensures equality', () => { // Make a sufficiently long list. - var a = Array(100).join('abcdefghijklmnopqrstuvwxyz').split(''); - var v1 = List(a); - var v2 = List(a); + const a = Array(100).join('abcdefghijklmnopqrstuvwxyz').split(''); + const v1 = List(a); + const v2 = List(a); + + // eslint-disable-next-line eqeqeq expect(v1 == v2).not.toBe(true); expect(v1 === v2).not.toBe(true); expect(v1.equals(v2)).toBe(true); }); + it('works with insert', () => { + const v = List.of('a', 'b', 'c'); + const m = v.insert(1, 'd'); + expect(m.size).toBe(4); + expect(m.get(1)).toBe('d'); + + // Works when index is greater than size of array. + const n = v.insert(10, 'e'); + expect(n.size).toBe(4); + expect(n.get(3)).toBe('e'); + + // Works when index is negative. + const o = v.insert(-4, 'f'); + expect(o.size).toBe(4); + expect(o.get(0)).toBe('f'); + }); + + it('works with push, set and insert without phantom values', () => { + const v = List.of().set(287, 287).push(42).insert(33, 33); + expect(v.toJS().filter((item) => item === 287)).toHaveLength(1); + const v2 = List.of().push(0).unshift(-1).unshift(-2).pop().pop().set(2, 2); + expect(v2.toJS()).toEqual([-2, undefined, 2]); + const v3 = List.of().set(447, 447).push(0).insert(65, 65); + expect(v3.toJS().filter((item) => item === 447)).toHaveLength(1); + const v4 = List.of().set(-28, -28).push(0).shift().set(-30, -30); + expect(v4.toJS().filter((item) => item === -28)).toHaveLength(0); + const v5 = List.of().unshift(0).set(33, 33).shift().set(-35, -35); + expect(v5.toJS().filter((item) => item === 0)).toHaveLength(0); + + // execute the same test as `v` but for the 2000 first integers + const isOkV1 = (v) => + List.of() + .set(v, v) + .push('pushed-value') + .insert(33, 'inserted-value') + .filter((item) => item === v).size === 1; + + const arr = new Array(2000).fill(null).map((_, v) => v); + + const notOkArray = arr.filter((v) => !isOkV1(v)); + + expect(notOkArray).toHaveLength(0); + }); + // TODO: assert that findIndex only calls the function as much as it needs to. - // TODO: assert that forEach iterates in the correct order and is only called as much as it needs to be. + it('forEach iterates in the correct order', () => { + let n = 0; + const a: Array = []; + const v = List.of(0, 1, 2, 3, 4); + v.forEach((x) => { + a.push(x); + n++; + }); + expect(n).toBe(5); + expect(a.length).toBe(5); + expect(a).toEqual([0, 1, 2, 3, 4]); + }); + + it('forEach iteration terminates when callback returns false', () => { + const a: Array = []; + function count(x) { + if (x > 2) { + return false; + } + a.push(x); + } + const v = List.of(0, 1, 2, 3, 4); + v.forEach(count); + expect(a).toEqual([0, 1, 2]); + }); it('concat works like Array.prototype.concat', () => { - var v1 = List.of(1, 2, 3); - var v2 = v1.concat(4, List.of(5, 6), [7, 8], Immutable.Seq({a:9,b:10}), Immutable.Set.of(11,12), null); + const v1 = List([1, 2, 3]); + const v2 = v1.concat( + 4, + List([5, 6]), + [7, 8], + Seq([9, 10]), + Set.of(11, 12), + null + ); expect(v1.toArray()).toEqual([1, 2, 3]); expect(v2.toArray()).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, null]); }); + it('concat works like Array.prototype.concat even for IE11', () => { + const v1 = List([1, 2, 3]); + const a = [4]; + + // remove Symbol.iterator as IE11 does not handle it. + // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/@@iterator#browser_compatibility + // @ts-expect-error -- simulate IE11 + a[Symbol.iterator] = undefined; + + const v2 = v1.concat(a); + expect(v1.toArray()).toEqual([1, 2, 3]); + expect(v2.toArray()).toEqual([1, 2, 3, 4]); + }); + + it('concat returns self when no changes', () => { + const v1 = List([1, 2, 3]); + expect(v1.concat([])).toBe(v1); + }); + + it('concat returns arg when concat to empty', () => { + const v1 = List([1, 2, 3]); + expect(List().concat(v1)).toBe(v1); + }); + + it('concats a single value', () => { + const v1 = List([1, 2, 3]); + expect(v1.concat(4)).toEqual(List([1, 2, 3, 4])); + }); + + it('concat returns List-coerced arg when concat to empty', () => { + expect(List().concat([1, 2, 3])).toEqual(List([1, 2, 3])); + }); + + it('concat does not spread in string characters', () => { + const v1 = List([1, 2, 3]); + expect(v1.concat('abcdef')).toEqual(List([1, 2, 3, 'abcdef'])); + }); + it('allows chained mutations', () => { - var v1 = List(); - var v2 = v1.push(1); - var v3 = v2.withMutations(v => v.push(2).push(3).push(4)); - var v4 = v3.push(5); + const v1 = List(); + const v2 = v1.push(1); + const v3 = v2.withMutations((v) => v.push(2).push(3).push(4)); + const v4 = v3.push(5); expect(v1.toArray()).toEqual([]); expect(v2.toArray()).toEqual([1]); - expect(v3.toArray()).toEqual([1,2,3,4]); - expect(v4.toArray()).toEqual([1,2,3,4,5]); + expect(v3.toArray()).toEqual([1, 2, 3, 4]); + expect(v4.toArray()).toEqual([1, 2, 3, 4, 5]); }); it('allows chained mutations using alternative API', () => { - var v1 = List(); - var v2 = v1.push(1); - var v3 = v2.asMutable().push(2).push(3).push(4).asImmutable(); - var v4 = v3.push(5); + const v1 = List(); + const v2 = v1.push(1); + const v3 = v2.asMutable().push(2).push(3).push(4).asImmutable(); + const v4 = v3.push(5); expect(v1.toArray()).toEqual([]); expect(v2.toArray()).toEqual([1]); - expect(v3.toArray()).toEqual([1,2,3,4]); - expect(v4.toArray()).toEqual([1,2,3,4,5]); + expect(v3.toArray()).toEqual([1, 2, 3, 4]); + expect(v4.toArray()).toEqual([1, 2, 3, 4, 5]); + }); + + it('chained mutations does not result in new empty list instance', () => { + const v1 = List(['x']); + const v2 = v1.withMutations((v) => v.push('y').pop().pop()); + expect(v2).toEqual(List()); + }); + + it('calling `clear` and `setSize` should set all items to undefined', () => { + const l = List(['a', 'b']); + const l2 = l.clear().setSize(3); + + expect(l2.get(0)).toBeUndefined(); + expect(l2.get(1)).toBeUndefined(); + expect(l2.get(2)).toBeUndefined(); + }); + + it('calling `clear` and `setSize` while mutating should set all items to undefined', () => { + const l = List(['a', 'b']); + const l2 = l.withMutations((innerList) => { + innerList.clear().setSize(3); + }); + expect(l2.get(0)).toBeUndefined(); + expect(l2.get(1)).toBeUndefined(); + expect(l2.get(2)).toBeUndefined(); }); it('allows size to be set', () => { - var v1 = Immutable.Range(0,2000).toList(); - var v2 = v1.setSize(1000); - var v3 = v2.setSize(1500); + const v1 = Range(0, 2000).toList(); + const v2 = v1.setSize(1000); + const v3 = v2.setSize(1500); expect(v1.size).toBe(2000); expect(v2.size).toBe(1000); expect(v3.size).toBe(1500); @@ -490,50 +893,184 @@ describe('List', () => { expect(v3.get(1800)).toBe(undefined); }); + it('discards truncated elements when using slice', () => { + const list: Array = [1, 2, 3, 4, 5, 6]; + const v1 = fromJS(list) as List; + const v2 = v1.slice(0, 3); + const v3 = v2.setSize(6); + + expect(v2.toArray()).toEqual(list.slice(0, 3)); + expect(v3.toArray()).toEqual( + list.slice(0, 3).concat([undefined, undefined, undefined]) + ); + }); + + it('discards truncated elements when using setSize', () => { + const list: Array = [1, 2, 3, 4, 5, 6]; + const v1 = fromJS(list) as List; + const v2 = v1.setSize(3); + const v3 = v2.setSize(6); + + expect(v2.toArray()).toEqual(list.slice(0, 3)); + expect(v3.toArray()).toEqual( + list.slice(0, 3).concat([undefined, undefined, undefined]) + ); + }); + it('can be efficiently sliced', () => { - var v1 = Immutable.Range(0,2000).toList(); - var v2 = v1.slice(100,-100).toList(); - expect(v1.size).toBe(2000) + const v1 = Range(0, 2000).toList(); + const v2 = v1.slice(100, -100).toList(); + const v3 = v2.slice(0, Infinity); + expect(v1.size).toBe(2000); expect(v2.size).toBe(1800); + expect(v3.size).toBe(1800); expect(v2.first()).toBe(100); expect(v2.rest().size).toBe(1799); expect(v2.last()).toBe(1899); expect(v2.butLast().size).toBe(1799); }); - describe('Iterator', () => { + [NaN, Infinity, -Infinity].forEach((zeroishValue) => { + it(`treats ${zeroishValue} like zero when setting size`, () => { + const v1 = List.of('a', 'b', 'c'); + const v2 = v1.setSize(zeroishValue); + expect(v2.size).toBe(0); + }); + }); - var pInt = gen.posInt; - - check.it('iterates through List', [pInt, pInt], (start, len) => { - var l = Immutable.Range(0, start + len).toList(); - l = > l.slice(start, start + len); - expect(l.size).toBe(len); - var valueIter = l.values(); - var keyIter = l.keys(); - var entryIter = l.entries(); - for (var ii = 0; ii < len; ii++) { - expect(valueIter.next().value).toBe(start + ii); - expect(keyIter.next().value).toBe(ii); - expect(entryIter.next().value).toEqual([ii, start + ii]); - } + it('Does not infinite loop when sliced with NaN #459', () => { + const list = List([1, 2, 3, 4, 5]); + const newList = list.slice(0, NaN); + expect(newList.toJS()).toEqual([]); + }); + + it('Accepts NaN for slice and concat #602', () => { + const list = List().slice(0, NaN).concat(NaN); + // toEqual([ NaN ]) + expect(list.size).toBe(1); + expect(isNaNValue(list.get(0))).toBe(true); + }); + + it('return a new emptyList if the emptyList has been mutated #2003', () => { + const emptyList = List(); + + const nonEmptyList = emptyList.withMutations((l) => { + l.setSize(1); + l.set(0, 'a'); }); - check.it('iterates through List in reverse', [pInt, pInt], (start, len) => { - var l = Immutable.Range(0, start + len).toList(); - l = > l.slice(start, start + len); - var s = l.toSeq().reverse(); // impl calls List.__iterator(REVERSE) - expect(s.size).toBe(len); - var valueIter = s.values(); - var keyIter = s.keys(); - var entryIter = s.entries(); - for (var ii = 0; ii < len; ii++) { - expect(valueIter.next().value).toBe(start + len - 1 - ii); - expect(keyIter.next().value).toBe(ii); - expect(entryIter.next().value).toEqual([ii, start + len - 1 - ii]); - } + expect(nonEmptyList.size).toBe(1); + expect(nonEmptyList).toEqual(List.of('a')); + expect(emptyList.size).toBe(0); + + const mutableList = emptyList.asMutable(); + + mutableList.setSize(1); + mutableList.set(0, 'b'); + + expect(mutableList.size).toBe(1); + expect(mutableList).toEqual(List.of('b')); + + expect(emptyList.size).toBe(0); + expect(List().size).toBe(0); + }); + + it('Mutating empty list with a JS API should not mutate new instances', () => { + Object.assign(List(), List([1, 2])); + + expect(List().size).toBe(0); + expect(List().toArray()).toEqual([]); + }); + + // Note: NaN is the only value not equal to itself. The isNaN() built-in + // function returns true for any non-numeric value, not just the NaN value. + function isNaNValue(value) { + return value !== value; + } + + describe('when slicing', () => { + [NaN, -Infinity].forEach((zeroishValue) => { + it(`considers a ${zeroishValue} begin argument to be zero`, () => { + const v1 = List.of('a', 'b', 'c'); + const v2 = v1.slice(zeroishValue, 3); + expect(v2.size).toBe(3); + }); + it(`considers a ${zeroishValue} end argument to be zero`, () => { + const v1 = List.of('a', 'b', 'c'); + const v2 = v1.slice(0, zeroishValue); + expect(v2.size).toBe(0); + }); + it(`considers ${zeroishValue} begin and end arguments to be zero`, () => { + const v1 = List.of('a', 'b', 'c'); + const v2 = v1.slice(zeroishValue, zeroishValue); + expect(v2.size).toBe(0); + }); }); + }); + + describe('when shuffling', () => { + const list = List.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); + it('should work when empty', () => { + expect(List().shuffle()).toStrictEqual(List()); + }); + it('should work with Math.random', () => { + expect(list.shuffle().sort()).toStrictEqual(list); + }); + it('should work with a pseudo random number generator', () => { + const seed = createSeed('lorem ipsum'); + const random = () => seed.random(); + + expect(list.shuffle(random)).toStrictEqual( + List.of(5, 2, 4, 7, 6, 3, 10, 1, 9, 8) + ); + expect(list.shuffle(random)).toStrictEqual( + List.of(1, 6, 2, 3, 9, 7, 4, 10, 5, 8) + ); + expect(list.shuffle(random)).toStrictEqual( + List.of(6, 1, 8, 10, 9, 5, 4, 7, 3, 2) + ); + }); }); + describe('Iterator', () => { + const pInt = fc.nat(100); + + it('iterates through List', () => { + fc.assert( + fc.property(pInt, pInt, (start, len) => { + const l1 = Range(0, start + len).toList(); + const l2: List = l1.slice(start, start + len); + expect(l2.size).toBe(len); + const valueIter = l2.values(); + const keyIter = l2.keys(); + const entryIter = l2.entries(); + for (let ii = 0; ii < len; ii++) { + expect(valueIter.next().value).toBe(start + ii); + expect(keyIter.next().value).toBe(ii); + expect(entryIter.next().value).toEqual([ii, start + ii]); + } + }) + ); + }); + + it('iterates through List in reverse', () => { + fc.assert( + fc.property(pInt, pInt, (start, len) => { + const l1 = Range(0, start + len).toList(); + const l2: List = l1.slice(start, start + len); + const s = l2.toSeq().reverse(); // impl calls List.__iterator(REVERSE) + expect(s.size).toBe(len); + const valueIter = s.values(); + const keyIter = s.keys(); + const entryIter = s.entries(); + for (let ii = 0; ii < len; ii++) { + expect(valueIter.next().value).toBe(start + len - 1 - ii); + expect(keyIter.next().value).toBe(ii); + expect(entryIter.next().value).toEqual([ii, start + len - 1 - ii]); + } + }) + ); + }); + }); }); diff --git a/__tests__/ListJS.js b/__tests__/ListJS.js new file mode 100644 index 0000000000..ae18d4881d --- /dev/null +++ b/__tests__/ListJS.js @@ -0,0 +1,47 @@ +import { describe, expect, it } from '@jest/globals'; +import { List } from 'immutable'; + +const NON_NUMBERS = { + array: ['not', 'a', 'number'], + NaN: NaN, + object: { not: 'a number' }, + string: 'not a number', +}; + +describe('List', () => { + describe('setSize()', () => { + Object.keys(NON_NUMBERS).forEach((type) => { + const nonNumber = NON_NUMBERS[type]; + it(`considers a size argument of type '${type}' to be zero`, () => { + const v1 = List.of(1, 2, 3); + const v2 = v1.setSize(nonNumber); + expect(v2.size).toBe(0); + }); + }); + }); + describe('slice()', () => { + // Mimic the behavior of Array::slice() + // http://www.ecma-international.org/ecma-262/6.0/#sec-array.prototype.slice + Object.keys(NON_NUMBERS).forEach((type) => { + const nonNumber = NON_NUMBERS[type]; + it(`considers a begin argument of type '${type}' to be zero`, () => { + const v1 = List.of('a', 'b', 'c'); + const v2 = v1.slice(nonNumber, 2); + expect(v2.size).toBe(2); + expect(v2.first()).toBe('a'); + expect(v2.rest().size).toBe(1); + expect(v2.last()).toBe('b'); + expect(v2.butLast().size).toBe(1); + }); + it(`considers an end argument of type '${type}' to be zero`, () => { + const v1 = List.of('a', 'b', 'c'); + const v2 = v1.slice(0, nonNumber); + expect(v2.size).toBe(0); + expect(v2.first()).toBe(undefined); + expect(v2.rest().size).toBe(0); + expect(v2.last()).toBe(undefined); + expect(v2.butLast().size).toBe(0); + }); + }); + }); +}); diff --git a/__tests__/Map.ts b/__tests__/Map.ts index 115842f361..d8ae8b16ca 100644 --- a/__tests__/Map.ts +++ b/__tests__/Map.ts @@ -1,18 +1,25 @@ -/// -/// - -jest.autoMockOff(); - -import jasmineCheck = require('jasmine-check'); -jasmineCheck.install(); - -import Immutable = require('immutable'); -import Map = Immutable.Map; +import { describe, expect, it, jest } from '@jest/globals'; +import { fromJS, is, List, Map, Range, Record, Seq } from 'immutable'; +import fc from 'fast-check'; describe('Map', () => { - it('converts from object', () => { - var m = Map({'a': 'A', 'b': 'B', 'c': 'C'}); + const m = Map({ a: 'A', b: 'B', c: 'C' }); + expect(m.size).toBe(3); + expect(m.get('a')).toBe('A'); + expect(m.get('b')).toBe('B'); + expect(m.get('c')).toBe('C'); + }); + + it('converts from JS (global) Map', () => { + const m = Map( + new global.Map([ + ['a', 'A'], + ['b', 'B'], + ['c', 'C'], + ]) + ); + expect(Map.isMap(m)).toBe(true); expect(m.size).toBe(3); expect(m.get('a')).toBe('A'); expect(m.get('b')).toBe('B'); @@ -20,7 +27,7 @@ describe('Map', () => { }); it('constructor provides initial values', () => { - var m = Map({'a': 'A', 'b': 'B', 'c': 'C'}); + const m = Map({ a: 'A', b: 'B', c: 'C' }); expect(m.size).toBe(3); expect(m.get('a')).toBe('A'); expect(m.get('b')).toBe('B'); @@ -28,7 +35,11 @@ describe('Map', () => { }); it('constructor provides initial values as array of entries', () => { - var m = Map([['a','A'],['b','B'],['c','C']]); + const m = Map([ + ['a', 'A'], + ['b', 'B'], + ['c', 'C'], + ]); expect(m.size).toBe(3); expect(m.get('a')).toBe('A'); expect(m.get('b')).toBe('B'); @@ -36,8 +47,8 @@ describe('Map', () => { }); it('constructor provides initial values as sequence', () => { - var s = Immutable.Seq({'a': 'A', 'b': 'B', 'c': 'C'}); - var m = Map(s); + const s = Seq({ a: 'A', b: 'B', c: 'C' }); + const m = Map(s); expect(m.size).toBe(3); expect(m.get('a')).toBe('A'); expect(m.get('b')).toBe('B'); @@ -45,77 +56,107 @@ describe('Map', () => { }); it('constructor provides initial values as list of lists', () => { - var l = Immutable.List([ - Immutable.List(['a', 'A']), - Immutable.List(['b', 'B']), - Immutable.List(['c', 'C']) - ]); - var m = Map(l); + const l = List([List(['a', 'A']), List(['b', 'B']), List(['c', 'C'])]); + const m = Map(l); expect(m.size).toBe(3); + // @ts-expect-error -- Not supported by typescript since 4.0.0 https://github.com/immutable-js/immutable-js/pull/1626 expect(m.get('a')).toBe('A'); + // @ts-expect-error -- Not supported by typescript since 4.0.0 https://github.com/immutable-js/immutable-js/pull/1626 expect(m.get('b')).toBe('B'); + // @ts-expect-error -- Not supported by typescript since 4.0.0 https://github.com/immutable-js/immutable-js/pull/1626 expect(m.get('c')).toBe('C'); }); it('constructor is identity when provided map', () => { - var m1 = Map({'a': 'A', 'b': 'B', 'c': 'C'}); - var m2 = Map(m1); + const m1 = Map({ a: 'A', b: 'B', c: 'C' }); + const m2 = Map(m1); expect(m2).toBe(m1); }); it('does not accept a scalar', () => { expect(() => { + // TODO: should expect error Map(3); - }).toThrow('Expected Array or iterable object of [k, v] entries, or keyed object: 3'); + }).toThrow( + 'Expected Array or collection object of [k, v] entries, or keyed object: 3' + ); }); - it('does not accept strings (iterable, but scalar)', () => { + it('does not accept strings (collection, but scalar)', () => { expect(() => { + // @ts-expect-error -- constructor does not accept strings, this is expected to throw Map('abc'); - }).toThrow('Expected Array or iterable object of [k, v] entries, or keyed object: abc'); + }).toThrow(); }); it('does not accept non-entries array', () => { expect(() => { - Map([1,2,3]); + // @ts-expect-error -- not an array of entries, this is expected to throw + Map([1, 2, 3]); }).toThrow('Expected [K, V] tuple: 1'); }); - it('accepts non-iterable array-like objects as keyed collections', () => { - var m = Map({ 'length': 3, '1': 'one' }); + it('accepts non-collection array-like objects as keyed collections', () => { + const m = Map({ length: 3, 1: 'one' }); expect(m.get('length')).toBe(3); + // @ts-expect-error -- type error, but the API is tolerante expect(m.get('1')).toBe('one'); - expect(m.toJS()).toEqual({ 'length': 3, '1': 'one' }); + expect(m.toJS()).toEqual({ length: 3, 1: 'one' }); }); it('converts back to JS object', () => { - var m = Map({'a': 'A', 'b': 'B', 'c': 'C'}); - expect(m.toObject()).toEqual({'a': 'A', 'b': 'B', 'c': 'C'}); + const m = Map({ a: 'A', b: 'B', c: 'C' }); + expect(m.toObject()).toEqual({ a: 'A', b: 'B', c: 'C' }); }); it('iterates values', () => { - var m = Map({'a': 'A', 'b': 'B', 'c': 'C'}); - var iterator = jest.genMockFunction(); + const m = Map({ a: 'A', b: 'B', c: 'C' }); + const iterator = jest.fn(); m.forEach(iterator); expect(iterator.mock.calls).toEqual([ ['A', 'a', m], ['B', 'b', m], - ['C', 'c', m] + ['C', 'c', m], ]); }); + it('has the same iterator function for entries', () => { + const m = Map({ a: 'A', b: 'B', c: 'C' }); + expect(m[Symbol.iterator]).toBe(m.entries); + }); + it('merges two maps', () => { - var m1 = Map({'a': 'A', 'b': 'B', 'c': 'C'}); - var m2 = Map({'wow': 'OO', 'd': 'DD', 'b': 'BB'}); - expect(m2.toObject()).toEqual({'wow': 'OO', 'd': 'DD', 'b': 'BB'}); - var m3 = m1.merge(m2); - expect(m3.toObject()).toEqual({'a': 'A', 'b': 'BB', 'c': 'C', 'wow': 'OO', 'd': 'DD'}); + const m1 = Map({ a: 'A', b: 'B', c: 'C' }); + const m2 = Map({ wow: 'OO', d: 'DD', b: 'BB' }); + expect(m2.toObject()).toEqual({ wow: 'OO', d: 'DD', b: 'BB' }); + const m3 = m1.merge(m2); + expect(m3.toObject()).toEqual({ + a: 'A', + b: 'BB', + c: 'C', + wow: 'OO', + d: 'DD', + }); + }); + + it('concatenates two maps (alias for merge)', () => { + const m1 = Map({ a: 'A', b: 'B', c: 'C' }); + const m2 = Map({ wow: 'OO', d: 'DD', b: 'BB' }); + expect(m2.toObject()).toEqual({ wow: 'OO', d: 'DD', b: 'BB' }); + const m3 = m1.concat(m2); + expect(m3.toObject()).toEqual({ + a: 'A', + b: 'BB', + c: 'C', + wow: 'OO', + d: 'DD', + }); }); it('accepts null as a key', () => { - var m1 = Map(); - var m2 = m1.set(null, 'null'); - var m3 = m2.remove(null); + const m1 = Map(); + const m2 = m1.set(null, 'null'); + const m3 = m2.remove(null); expect(m1.size).toBe(0); expect(m2.size).toBe(1); expect(m3.size).toBe(0); @@ -123,11 +164,11 @@ describe('Map', () => { }); it('is persistent to sets', () => { - var m1 = Map(); - var m2 = m1.set('a', 'Aardvark'); - var m3 = m2.set('b', 'Baboon'); - var m4 = m3.set('c', 'Canary'); - var m5 = m4.set('b', 'Bonobo'); + const m1 = Map(); + const m2 = m1.set('a', 'Aardvark'); + const m3 = m2.set('b', 'Baboon'); + const m4 = m3.set('c', 'Canary'); + const m5 = m4.set('b', 'Bonobo'); expect(m1.size).toBe(0); expect(m2.size).toBe(1); expect(m3.size).toBe(2); @@ -138,11 +179,11 @@ describe('Map', () => { }); it('is persistent to deletes', () => { - var m1 = Map(); - var m2 = m1.set('a', 'Aardvark'); - var m3 = m2.set('b', 'Baboon'); - var m4 = m3.set('c', 'Canary'); - var m5 = m4.remove('b'); + const m1 = Map(); + const m2 = m1.set('a', 'Aardvark'); + const m3 = m2.set('b', 'Baboon'); + const m4 = m3.set('c', 'Canary'); + const m5 = m4.remove('b'); expect(m1.size).toBe(0); expect(m2.size).toBe(1); expect(m3.size).toBe(2); @@ -155,29 +196,47 @@ describe('Map', () => { expect(m5.get('c')).toBe('Canary'); }); - check.it('deletes down to empty map', [gen.posInt], size => { - var m = Immutable.Range(0, size).toMap(); - expect(m.size).toBe(size); - for (var ii = size - 1; ii >= 0; ii--) { - m = m.remove(ii); - expect(m.size).toBe(ii); - } - expect(m).toBe(Map()); + it('deletes down to empty map', () => { + fc.assert( + fc.property(fc.nat(100), (size) => { + let m = Range(0, size).toMap(); + expect(m.size).toBe(size); + for (let ii = size - 1; ii >= 0; ii--) { + m = m.remove(ii); + expect(m.size).toBe(ii); + } + expect(m).toBe(Map()); + }) + ); }); it('can map many items', () => { - var m = Map(); - for (var ii = 0; ii < 2000; ii++) { - m = m.set('thing:' + ii, ii); + let m = Map(); + for (let ii = 0; ii < 2000; ii++) { + m = m.set('thing:' + ii, ii); } expect(m.size).toBe(2000); expect(m.get('thing:1234')).toBe(1234); }); + it('can use weird keys', () => { + const symbol = Symbol('A'); + const m = Map() + .set(NaN, 1) + .set(Infinity, 2) + .set(symbol, 'A') + .set(-Infinity, 3); + + expect(m.get(symbol)).toBe('A'); + expect(m.get(NaN)).toBe(1); + expect(m.get(Infinity)).toBe(2); + expect(m.get(-Infinity)).toBe(3); + }); + it('can map items known to hash collide', () => { // make a big map, so it hashmaps - var m: Map = Immutable.Range(0, 32).toMap(); - var m = m.set('AAA', 'letters').set(64545, 'numbers'); + let m: Map = Range(0, 32).toMap(); + m = m.set('AAA', 'letters').set(64545, 'numbers'); expect(m.size).toBe(34); expect(m.get('AAA')).toEqual('letters'); expect(m.get(64545)).toEqual('numbers'); @@ -185,7 +244,7 @@ describe('Map', () => { it('can progressively add items known to collide', () => { // make a big map, so it hashmaps - var map: Map = Immutable.Range(0, 32).toMap(); + let map: Map = Range(0, 32).toMap(); map = map.set('@', '@'); map = map.set(64, 64); map = map.set(96, 96); @@ -196,43 +255,76 @@ describe('Map', () => { }); it('maps values', () => { - var m = Map({a:'a', b:'b', c:'c'}); - var r = m.map(value => value.toUpperCase()); - expect(r.toObject()).toEqual({a:'A', b:'B', c:'C'}); + const m = Map({ a: 'a', b: 'b', c: 'c' }); + const r = m.map((value) => value.toUpperCase()); + expect(r.toObject()).toEqual({ a: 'A', b: 'B', c: 'C' }); }); it('maps keys', () => { - var m = Map({a:'a', b:'b', c:'c'}); - var r = m.mapKeys(key => key.toUpperCase()); - expect(r.toObject()).toEqual({A:'a', B:'b', C:'c'}); + const m = Map({ a: 'a', b: 'b', c: 'c' }); + const r = m.mapKeys((key) => key.toUpperCase()); + expect(r.toObject()).toEqual({ A: 'a', B: 'b', C: 'c' }); + }); + + it('maps no-ops return the same reference', () => { + const m = Map({ a: 'a', b: 'b', c: 'c' }); + const r = m.map((value) => value); + expect(r).toBe(m); + }); + + it('provides unmodified original collection as 3rd iter argument', () => { + const m = Map({ a: 1, b: 1 }); + const r = m.map((value, key, iter) => { + expect(iter).toEqual(m); + return 2 * (iter.get(key) as number); + }); + expect(r.toObject()).toEqual({ a: 2, b: 2 }); }); it('filters values', () => { - var m = Map({a:1, b:2, c:3, d:4, e:5, f:6}); - var r = m.filter(value => value % 2 === 1); - expect(r.toObject()).toEqual({a:1, c:3, e:5}); + const m = Map({ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }); + const r = m.filter((value) => value % 2 === 1); + expect(r.toObject()).toEqual({ a: 1, c: 3, e: 5 }); }); it('filterNots values', () => { - var m = Map({a:1, b:2, c:3, d:4, e:5, f:6}); - var r = m.filterNot(value => value % 2 === 1); - expect(r.toObject()).toEqual({b:2, d:4, f:6}); + const m = Map({ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }); + const r = m.filterNot((value) => value % 2 === 1); + expect(r.toObject()).toEqual({ b: 2, d: 4, f: 6 }); + }); + + it('partitions values', () => { + const m = Map({ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }); + const r = m + .partition((value) => value % 2 === 1) + .map((part) => part.toObject()); + expect(r).toEqual([ + { b: 2, d: 4, f: 6 }, + { a: 1, c: 3, e: 5 }, + ]); }); it('derives keys', () => { - var v = Map({a:1, b:2, c:3, d:4, e:5, f:6}); + const v = Map({ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }); expect(v.keySeq().toArray()).toEqual(['a', 'b', 'c', 'd', 'e', 'f']); }); it('flips keys and values', () => { - var v = Map({a:1, b:2, c:3, d:4, e:5, f:6}); - expect(v.flip().toObject()).toEqual({1:'a', 2:'b', 3:'c', 4:'d', 5:'e', 6:'f'}); + const v = Map({ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }); + expect(v.flip().toObject()).toEqual({ + 1: 'a', + 2: 'b', + 3: 'c', + 4: 'd', + 5: 'e', + 6: 'f', + }); }); it('can convert to a list', () => { - var m = Map({a:1, b:2, c:3}); - var v = m.toList(); - var k = m.keySeq().toList(); + const m = Map({ a: 1, b: 2, c: 3 }); + const v = m.toList(); + const k = m.keySeq().toList(); expect(v.size).toBe(3); expect(k.size).toBe(3); // Note: Map has undefined ordering, this List may not be the same @@ -241,85 +333,261 @@ describe('Map', () => { expect(k.get(1)).toBe('b'); }); - check.it('works like an object', {maxSize: 50}, [gen.object(gen.JSONPrimitive)], obj => { - var map = Immutable.Map(obj); - Object.keys(obj).forEach(key => { - expect(map.get(key)).toBe(obj[key]); - expect(map.has(key)).toBe(true); - }); - Object.keys(obj).forEach(key => { - expect(map.get(key)).toBe(obj[key]); - expect(map.has(key)).toBe(true); - map = map.remove(key); - expect(map.get(key)).toBe(undefined); - expect(map.has(key)).toBe(false); - }); + it('works like an object', () => { + fc.assert( + fc.property(fc.object({ maxKeys: 50 }), (obj) => { + let map = Map(obj); + Object.keys(obj).forEach((key) => { + expect(map.get(key)).toBe(obj[key]); + expect(map.has(key)).toBe(true); + }); + Object.keys(obj).forEach((key) => { + expect(map.get(key)).toBe(obj[key]); + expect(map.has(key)).toBe(true); + map = map.remove(key); + expect(map.get(key)).toBe(undefined); + expect(map.has(key)).toBe(false); + }); + }) + ); + }); + + it('sets', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + let map = Map(); + for (let ii = 0; ii < len; ii++) { + expect(map.size).toBe(ii); + map = map.set('' + ii, ii); + } + expect(map.size).toBe(len); + expect(is(map.toSet(), Range(0, len).toSet())).toBe(true); + }) + ); + }); + + it('has and get', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const map = Range(0, len) + .toKeyedSeq() + .mapKeys((x) => '' + x) + .toMap(); + for (let ii = 0; ii < len; ii++) { + expect(map.get('' + ii)).toBe(ii); + expect(map.has('' + ii)).toBe(true); + } + }) + ); + }); + + it('deletes', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + let map = Range(0, len).toMap(); + for (let ii = 0; ii < len; ii++) { + expect(map.size).toBe(len - ii); + map = map.remove(ii); + } + expect(map.size).toBe(0); + expect(map.toObject()).toEqual({}); + }) + ); + }); + + it('deletes from transient', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const map = Range(0, len).toMap().asMutable(); + for (let ii = 0; ii < len; ii++) { + expect(map.size).toBe(len - ii); + map.remove(ii); + } + expect(map.size).toBe(0); + expect(map.toObject()).toEqual({}); + }) + ); + }); + + it('iterates through all entries', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const v = Range(0, len).toMap(); + const a = v.toArray(); + const iter = v.entries(); + for (let ii = 0; ii < len; ii++) { + delete a[iter.next().value[0]]; + } + expect(a).toEqual(new Array(len)); + }) + ); }); - check.it('sets', {maxSize: 5000}, [gen.posInt], len => { - var map = Immutable.Map(); - for (var ii = 0; ii < len; ii++) { - expect(map.size).toBe(ii); - map = map.set(''+ii, ii); - } - expect(map.size).toBe(len); - expect(Immutable.is(map.toSet(), Immutable.Range(0, len).toSet())).toBe(true); + it('allows chained mutations', () => { + const m1 = Map(); + const m2 = m1.set('a', 1); + const m3 = m2.withMutations((m) => m.set('b', 2).set('c', 3)); + const m4 = m3.set('d', 4); + + expect(m1.toObject()).toEqual({}); + expect(m2.toObject()).toEqual({ a: 1 }); + expect(m3.toObject()).toEqual({ a: 1, b: 2, c: 3 }); + expect(m4.toObject()).toEqual({ a: 1, b: 2, c: 3, d: 4 }); }); - check.it('has and get', {maxSize: 5000}, [gen.posInt], len => { - var map = Immutable.Range(0, len).toKeyedSeq().mapKeys(x => ''+x).toMap(); - for (var ii = 0; ii < len; ii++) { - expect(map.get(''+ii)).toBe(ii); - expect(map.has(''+ii)).toBe(true); - } + it('chained mutations does not result in new empty map instance', () => { + const v1 = Map<{ x?: number; y?: number }>({ x: 1 }); + const v2 = v1.withMutations((v) => v.set('y', 2).delete('x').delete('y')); + expect(v2).toBe(Map()); }); - check.it('deletes', {maxSize: 5000}, [gen.posInt], len => { - var map = Immutable.Range(0, len).toMap(); - for (var ii = 0; ii < len; ii++) { - expect(map.size).toBe(len - ii); - map = map.remove(ii); - } - expect(map.size).toBe(0); - expect(map.toObject()).toEqual({}); + it('expresses value equality with unordered sequences', () => { + const m1 = Map({ A: 1, B: 2, C: 3 }); + const m2 = Map({ C: 3, B: 2, A: 1 }); + expect(is(m1, m2)).toBe(true); }); - check.it('deletes from transient', {maxSize: 5000}, [gen.posInt], len => { - var map = Immutable.Range(0, len).toMap().asMutable(); - for (var ii = 0; ii < len; ii++) { - expect(map.size).toBe(len - ii); - map.remove(ii); - } - expect(map.size).toBe(0); - expect(map.toObject()).toEqual({}); + it('does not equal Record with same values', () => { + const m1 = Map({ A: 1, B: 2, C: 3 }); + const m2 = Record({ A: 1, B: 2, C: 3 }); + expect(is(m1, m2)).toBe(false); }); - check.it('iterates through all entries', [gen.posInt], len => { - var v = Immutable.Range(0, len).toMap(); - var a = v.toArray(); - var iter = v.entries(); - for (var ii = 0; ii < len; ii++) { - delete a[ iter.next().value[0] ]; - } - expect(a).toEqual(new Array(len)); + it('deletes all the provided keys', () => { + const NOT_SET = undefined; + const m1 = Map({ A: 1, B: 2, C: 3 }); + const m2 = m1.deleteAll(['A', 'B']); + expect(m2.get('A')).toBe(NOT_SET); + expect(m2.get('B')).toBe(NOT_SET); + expect(m2.get('C')).toBe(3); + expect(m2.size).toBe(1); }); - it('allows chained mutations', () => { - var m1 = Map(); - var m2 = m1.set('a', 1); - var m3 = m2.withMutations(m => m.set('b', 2).set('c', 3)); - var m4 = m3.set('d', 4); + it('remains unchanged when no keys are provided', () => { + const m1 = Map({ A: 1, B: 2, C: 3 }); + const m2 = m1.deleteAll([]); + expect(m1).toBe(m2); + }); - expect(m1.toObject()).toEqual({}); - expect(m2.toObject()).toEqual({'a':1}); - expect(m3.toObject()).toEqual({'a': 1, 'b': 2, 'c': 3}); - expect(m4.toObject()).toEqual({'a': 1, 'b': 2, 'c': 3, 'd': 4}); + it('uses toString on keys and values', () => { + class A extends Record({ x: null as number | null }) { + toString() { + return this.x; + } + } + + const r = new A({ x: 2 }); + const map = Map([[r, r]]); + expect(map.toString()).toEqual('Map { 2: 2 }'); }); - it('expresses value equality with unordered sequences', () => { - var m1 = Map({ A: 1, B: 2, C: 3 }); - var m2 = Map({ C: 3, B: 2, A: 1 }); - expect(Immutable.is(m1, m2)).toBe(true); + it('supports Symbols as tuple keys', () => { + const a = Symbol('a'); + const b = Symbol('b'); + const c = Symbol('c'); + const m = Map([ + [a, 'a'], + [b, 'b'], + [c, 'c'], + ]); + expect(m.size).toBe(3); + expect(m.get(a)).toBe('a'); + expect(m.get(b)).toBe('b'); + expect(m.get(c)).toBe('c'); + }); + + it('supports Symbols as object constructor keys', () => { + const a = Symbol.for('a'); + const b = Symbol('b'); + const c = Symbol('c'); + const m = Map({ + [a]: 'a', + [b]: 'b', + [c]: 'c', + }); + expect(m.size).toBe(3); + expect(m.get(a)).toBe('a'); + expect(m.get(b)).toBe('b'); + expect(m.get(c)).toBe('c'); + + const m2 = fromJS({ [a]: 'a' }) as Map; + expect(m2.size).toBe(1); + expect(m2.get(a)).toBe('a'); }); + it('Symbol keys are unique', () => { + const a = Symbol('FooBar'); + const b = Symbol('FooBar'); + const m = Map([ + [a, 'FizBuz'], + [b, 'FooBar'], + ]); + expect(m.size).toBe(2); + expect(m.get(a)).toBe('FizBuz'); + expect(m.get(b)).toBe('FooBar'); + }); + + it('mergeDeep with tuple Symbol keys', () => { + const a = Symbol('a'); + const b = Symbol('b'); + const c = Symbol('c'); + const d = Symbol('d'); + const e = Symbol('e'); + const f = Symbol('f'); + const g = Symbol('g'); + + // Note the use of nested Map constructors, Map() does not do a + // deep conversion! + const m1 = Map([ + [ + a, + Map([ + [ + b, + Map([ + [c, 1], + [d, 2], + ]), + ], + ]), + ], + ]); + const m2 = Map([ + [ + a, + Map([ + [ + b, + Map([ + [c, 10], + [e, 20], + [f, 30], + [g, 40], + ]), + ], + ]), + ], + ]); + const merged = m1.mergeDeep(m2); + + expect(merged).toEqual( + Map([ + [ + a, + Map([ + [ + b, + Map([ + [c, 10], + [d, 2], + [e, 20], + [f, 30], + [g, 40], + ]), + ], + ]), + ], + ]) + ); + }); }); diff --git a/__tests__/MultiRequire.js b/__tests__/MultiRequire.js index ebae7f3748..17c3de9472 100644 --- a/__tests__/MultiRequire.js +++ b/__tests__/MultiRequire.js @@ -1,33 +1,40 @@ -jest.autoMockOff(); +import { describe, expect, it, jest } from '@jest/globals'; +import * as Immutable1 from '../src/Immutable'; -var Immutable1 = require('../'); -jest.resetModuleRegistry(); -var Immutable2 = require('../'); +jest.resetModules(); -describe('MultiRequire', () => { +const Immutable2 = jest.requireActual('../src/Immutable'); +describe('MultiRequire', () => { it('might require two different instances of Immutable', () => { expect(Immutable1).not.toBe(Immutable2); - expect(Immutable1.Map({a: 1}).toJS()).toEqual({a: 1}); - expect(Immutable2.Map({a: 1}).toJS()).toEqual({a: 1}); + expect(Immutable1.Map({ a: 1 }).toJS()).toEqual({ a: 1 }); + expect(Immutable2.Map({ a: 1 }).toJS()).toEqual({ a: 1 }); }); it('detects sequences', () => { - var x = Immutable1.Map({a: 1}); - var y = Immutable2.Map({a: 1}); - expect(Immutable1.Iterable.isIterable(y)).toBe(true); - expect(Immutable2.Iterable.isIterable(x)).toBe(true); + const x = Immutable1.Map({ a: 1 }); + const y = Immutable2.Map({ a: 1 }); + expect(Immutable1.isCollection(y)).toBe(true); + expect(Immutable2.isCollection(x)).toBe(true); + }); + + it('detects records', () => { + const R1 = Immutable1.Record({ a: 1 }); + const R2 = Immutable2.Record({ a: 1 }); + expect(Immutable1.Record.isRecord(R2())).toBe(true); + expect(Immutable2.Record.isRecord(R1())).toBe(true); }); it('converts to JS when inter-nested', () => { - var deep = Immutable1.Map({ + const deep = Immutable1.Map({ a: 1, b: 2, c: Immutable2.Map({ x: 3, y: 4, - z: Immutable1.Map() - }) + z: Immutable1.Map(), + }), }); expect(deep.toJS()).toEqual({ @@ -36,55 +43,50 @@ describe('MultiRequire', () => { c: { x: 3, y: 4, - z: {} - } + z: {}, + }, }); }); it('compares for equality', () => { - var x = Immutable1.Map({a: 1}); - var y = Immutable2.Map({a: 1}); + const x = Immutable1.Map({ a: 1 }); + const y = Immutable2.Map({ a: 1 }); expect(Immutable1.is(x, y)).toBe(true); expect(Immutable2.is(x, y)).toBe(true); }); it('flattens nested values', () => { - var nested = Immutable1.List( - Immutable2.List( - Immutable1.List( - Immutable2.List.of(1, 2) - ) - ) + const nested = Immutable1.List( + Immutable2.List(Immutable1.List(Immutable2.List.of(1, 2))) ); - expect(nested.flatten().toJS()).toEqual([1,2]); + expect(nested.flatten().toJS()).toEqual([1, 2]); }); it('detects types', () => { - var c1 = Immutable1.Map(); - var c2 = Immutable2.Map(); + let c1 = Immutable1.Map(); + let c2 = Immutable2.Map(); expect(Immutable1.Map.isMap(c2)).toBe(true); expect(Immutable2.Map.isMap(c1)).toBe(true); - var c1 = Immutable1.OrderedMap(); - var c2 = Immutable2.OrderedMap(); + c1 = Immutable1.OrderedMap(); + c2 = Immutable2.OrderedMap(); expect(Immutable1.OrderedMap.isOrderedMap(c2)).toBe(true); expect(Immutable2.OrderedMap.isOrderedMap(c1)).toBe(true); - var c1 = Immutable1.List(); - var c2 = Immutable2.List(); + c1 = Immutable1.List(); + c2 = Immutable2.List(); expect(Immutable1.List.isList(c2)).toBe(true); expect(Immutable2.List.isList(c1)).toBe(true); - var c1 = Immutable1.Stack(); - var c2 = Immutable2.Stack(); + c1 = Immutable1.Stack(); + c2 = Immutable2.Stack(); expect(Immutable1.Stack.isStack(c2)).toBe(true); expect(Immutable2.Stack.isStack(c1)).toBe(true); - var c1 = Immutable1.Set(); - var c2 = Immutable2.Set(); + c1 = Immutable1.Set(); + c2 = Immutable2.Set(); expect(Immutable1.Set.isSet(c2)).toBe(true); expect(Immutable2.Set.isSet(c1)).toBe(true); }); - }); diff --git a/__tests__/ObjectSeq.ts b/__tests__/ObjectSeq.ts index c5924d706e..2b10807cb5 100644 --- a/__tests__/ObjectSeq.ts +++ b/__tests__/ObjectSeq.ts @@ -1,46 +1,49 @@ -/// -/// - -jest.autoMockOff(); - -import Immutable = require('immutable'); +import { describe, expect, it } from '@jest/globals'; +import { Seq } from 'immutable'; describe('ObjectSequence', () => { - it('maps', () => { - var i = Immutable.Seq({'a': 'A', 'b': 'B', 'c': 'C'}); - var m = i.map(x => x + x).toObject(); - expect(m).toEqual({'a': 'AA', 'b': 'BB', 'c': 'CC'}); + const i = Seq({ a: 'A', b: 'B', c: 'C' }); + const m = i.map((x) => x + x).toObject(); + expect(m).toEqual({ a: 'AA', b: 'BB', c: 'CC' }); }); it('reduces', () => { - var i = Immutable.Seq({'a': 'A', 'b': 'B', 'c': 'C'}); - var r = i.reduce((r, x) => r + x, ''); + const i = Seq({ a: 'A', b: 'B', c: 'C' }); + const r = i.reduce((acc, x) => acc + x, ''); expect(r).toEqual('ABC'); }); it('extracts keys', () => { - var i = Immutable.Seq({'a': 'A', 'b': 'B', 'c': 'C'}); - var k = i.keySeq().toArray(); + const i = Seq({ a: 'A', b: 'B', c: 'C' }); + const k = i.keySeq().toArray(); expect(k).toEqual(['a', 'b', 'c']); }); it('is reversable', () => { - var i = Immutable.Seq({'a': 'A', 'b': 'B', 'c': 'C'}); - var k = i.reverse().toArray(); - expect(k).toEqual(['C', 'B', 'A']); + const i = Seq({ a: 'A', b: 'B', c: 'C' }); + const k = i.reverse().toArray(); + expect(k).toEqual([ + ['c', 'C'], + ['b', 'B'], + ['a', 'A'], + ]); }); - it('can double reversable', () => { - var i = Immutable.Seq({'a': 'A', 'b': 'B', 'c': 'C'}); - var k = i.reverse().reverse().toArray(); - expect(k).toEqual(['A', 'B', 'C']); + it('is double reversable', () => { + const i = Seq({ a: 'A', b: 'B', c: 'C' }); + const k = i.reverse().reverse().toArray(); + expect(k).toEqual([ + ['a', 'A'], + ['b', 'B'], + ['c', 'C'], + ]); }); it('can be iterated', () => { - var obj = { a: 1, b: 2, c: 3 }; - var seq = Immutable.Seq(obj); - var entries = seq.entries(); + const obj = { a: 1, b: 2, c: 3 }; + const seq = Seq(obj); + const entries = seq.entries(); expect(entries.next()).toEqual({ value: ['a', 1], done: false }); expect(entries.next()).toEqual({ value: ['b', 2], done: false }); expect(entries.next()).toEqual({ value: ['c', 3], done: false }); @@ -48,11 +51,11 @@ describe('ObjectSequence', () => { }); it('cannot be mutated after calling toObject', () => { - var seq = Immutable.Seq({ a: 1, b: 2, c: 3 }); + const seq = Seq({ a: 1, b: 2, c: 3 }); - var obj = seq.toObject(); - obj['c'] = 10; - var seq2 = Immutable.Seq(obj); + const obj = seq.toObject(); + obj.c = 10; + const seq2 = Seq(obj); expect(seq.get('c')).toEqual(3); expect(seq2.get('c')).toEqual(10); diff --git a/__tests__/OrderedMap.ts b/__tests__/OrderedMap.ts index ecfbdb878e..9c06a6582e 100644 --- a/__tests__/OrderedMap.ts +++ b/__tests__/OrderedMap.ts @@ -1,72 +1,88 @@ -/// -/// - -jest.autoMockOff(); - -import Immutable = require('immutable'); -import OrderedMap = Immutable.OrderedMap; +import { describe, expect, it } from '@jest/globals'; +import { OrderedMap, Range, Seq } from 'immutable'; describe('OrderedMap', () => { - it('converts from object', () => { - var m = OrderedMap({'c': 'C', 'b': 'B', 'a': 'A'}); + const m = OrderedMap({ c: 'C', b: 'B', a: 'A' }); expect(m.get('a')).toBe('A'); expect(m.get('b')).toBe('B'); expect(m.get('c')).toBe('C'); - expect(m.toArray()).toEqual(['C','B','A']); + expect(m.toArray()).toEqual([ + ['c', 'C'], + ['b', 'B'], + ['a', 'A'], + ]); }); it('constructor provides initial values', () => { - var m = OrderedMap({'a': 'A', 'b': 'B', 'c': 'C'}); + const m = OrderedMap({ a: 'A', b: 'B', c: 'C' }); expect(m.get('a')).toBe('A'); expect(m.get('b')).toBe('B'); expect(m.get('c')).toBe('C'); expect(m.size).toBe(3); - expect(m.toArray()).toEqual(['A','B','C']); + expect(m.toArray()).toEqual([ + ['a', 'A'], + ['b', 'B'], + ['c', 'C'], + ]); }); it('provides initial values in a mixed order', () => { - var m = OrderedMap({'c': 'C', 'b': 'B', 'a': 'A'}); + const m = OrderedMap({ c: 'C', b: 'B', a: 'A' }); expect(m.get('a')).toBe('A'); expect(m.get('b')).toBe('B'); expect(m.get('c')).toBe('C'); expect(m.size).toBe(3); - expect(m.toArray()).toEqual(['C','B','A']); + expect(m.toArray()).toEqual([ + ['c', 'C'], + ['b', 'B'], + ['a', 'A'], + ]); }); it('constructor accepts sequences', () => { - var s = Immutable.Seq({'c': 'C', 'b': 'B', 'a': 'A'}); - var m = OrderedMap(s); + const s = Seq({ c: 'C', b: 'B', a: 'A' }); + const m = OrderedMap(s); expect(m.get('a')).toBe('A'); expect(m.get('b')).toBe('B'); expect(m.get('c')).toBe('C'); expect(m.size).toBe(3); - expect(m.toArray()).toEqual(['C','B','A']); + expect(m.toArray()).toEqual([ + ['c', 'C'], + ['b', 'B'], + ['a', 'A'], + ]); }); it('maintains order when new keys are set', () => { - var m = OrderedMap() + const m = OrderedMap() .set('A', 'aardvark') .set('Z', 'zebra') .set('A', 'antelope'); expect(m.size).toBe(2); - expect(m.toArray()).toEqual(['antelope', 'zebra']); + expect(m.toArray()).toEqual([ + ['A', 'antelope'], + ['Z', 'zebra'], + ]); }); it('resets order when a keys is deleted', () => { - var m = OrderedMap() + const m = OrderedMap() .set('A', 'aardvark') .set('Z', 'zebra') .remove('A') .set('A', 'antelope'); expect(m.size).toBe(2); - expect(m.toArray()).toEqual(['zebra', 'antelope']); + expect(m.toArray()).toEqual([ + ['Z', 'zebra'], + ['A', 'antelope'], + ]); }); it('removes correctly', () => { - var m = OrderedMap({ - 'A': 'aardvark', - 'Z': 'zebra' + const m = OrderedMap({ + A: 'aardvark', + Z: 'zebra', }).remove('A'); expect(m.size).toBe(1); expect(m.get('A')).toBe(undefined); @@ -74,21 +90,53 @@ describe('OrderedMap', () => { }); it('respects order for equality', () => { - var m1 = OrderedMap().set('A', 'aardvark').set('Z', 'zebra'); - var m2 = OrderedMap().set('Z', 'zebra').set('A', 'aardvark'); + const m1 = OrderedMap().set('A', 'aardvark').set('Z', 'zebra'); + const m2 = OrderedMap().set('Z', 'zebra').set('A', 'aardvark'); expect(m1.equals(m2)).toBe(false); expect(m1.equals(m2.reverse())).toBe(true); }); it('respects order when merging', () => { - var m1 = OrderedMap({A: 'apple', B: 'banana', C: 'coconut'}); - var m2 = OrderedMap({C: 'chocolate', B: 'butter', D: 'donut'}); - expect(m1.merge(m2).entrySeq().toArray()).toEqual( - [['A','apple'],['B','butter'],['C','chocolate'],['D','donut']] - ); - expect(m2.merge(m1).entrySeq().toArray()).toEqual( - [['C','coconut'],['B','banana'],['D','donut'],['A','apple']] - ); + const m1 = OrderedMap({ A: 'apple', B: 'banana', C: 'coconut' }); + const m2 = OrderedMap({ C: 'chocolate', B: 'butter', D: 'donut' }); + expect(m1.merge(m2).entrySeq().toArray()).toEqual([ + ['A', 'apple'], + ['B', 'butter'], + ['C', 'chocolate'], + ['D', 'donut'], + ]); + expect(m2.merge(m1).entrySeq().toArray()).toEqual([ + ['C', 'coconut'], + ['B', 'banana'], + ['D', 'donut'], + ['A', 'apple'], + ]); }); + it('performs deleteAll correctly after resizing internal list', () => { + // See condition for resizing internal list here: + // https://github.com/immutable-js/immutable-js/blob/91c7c1e82ec616804768f968cc585565e855c8fd/src/OrderedMap.js#L138 + + // Create OrderedMap greater than or equal to SIZE (currently 32) + const SIZE = 32; + let map = OrderedMap(Range(0, SIZE).map((key) => [key, 0])); + + // Delete half of the keys so that internal list is twice the size of internal map + const keysToDelete = Range(0, SIZE / 2); + map = map.deleteAll(keysToDelete); + + // Delete one more key to trigger resizing + map = map.deleteAll([SIZE / 2]); + + expect(map.size).toBe(SIZE / 2 - 1); + }); + + it('hashCode should return the same value if the values are the same', () => { + const m1 = OrderedMap({ b: 'b' }); + const m2 = OrderedMap({ a: 'a', b: 'b' }).remove('a'); + const m3 = OrderedMap({ b: 'b' }).remove('b').set('b', 'b'); + + expect(m1.hashCode()).toEqual(m2.hashCode()); + expect(m1.hashCode()).toEqual(m3.hashCode()); + }); }); diff --git a/__tests__/OrderedSet.ts b/__tests__/OrderedSet.ts index e6e77ae572..12c958072d 100644 --- a/__tests__/OrderedSet.ts +++ b/__tests__/OrderedSet.ts @@ -1,60 +1,153 @@ -/// -/// - -jest.autoMockOff(); - -import Immutable = require('immutable'); -import OrderedSet = Immutable.OrderedSet; +import { describe, expect, it } from '@jest/globals'; +import { OrderedSet, Map } from 'immutable'; describe('OrderedSet', () => { - it('provides initial values in a mixed order', () => { - var s = OrderedSet.of('C', 'B', 'A'); + const s = OrderedSet.of('C', 'B', 'A'); expect(s.has('A')).toBe(true); expect(s.has('B')).toBe(true); expect(s.has('C')).toBe(true); expect(s.size).toBe(3); - expect(s.toArray()).toEqual(['C','B','A']); + expect(s.toArray()).toEqual(['C', 'B', 'A']); }); it('maintains order when new values are added', () => { - var s = OrderedSet() - .add('A') - .add('Z') - .add('A'); + const s = OrderedSet().add('A').add('Z').add('A'); expect(s.size).toBe(2); expect(s.toArray()).toEqual(['A', 'Z']); }); it('resets order when a value is deleted', () => { - var s = OrderedSet() - .add('A') - .add('Z') - .remove('A') - .add('A'); + const s = OrderedSet().add('A').add('Z').remove('A').add('A'); expect(s.size).toBe(2); expect(s.toArray()).toEqual(['Z', 'A']); }); it('removes correctly', () => { - var s = OrderedSet([ 'A', 'Z' ]).remove('A'); + const s = OrderedSet(['A', 'Z']).remove('A'); expect(s.size).toBe(1); expect(s.has('A')).toBe(false); expect(s.has('Z')).toBe(true); }); it('respects order for equality', () => { - var s1 = OrderedSet.of('A', 'Z') - var s2 = OrderedSet.of('Z', 'A') + const s1 = OrderedSet.of('A', 'Z'); + const s2 = OrderedSet.of('Z', 'A'); expect(s1.equals(s2)).toBe(false); expect(s1.equals(s2.reverse())).toBe(true); }); it('respects order when unioning', () => { - var s1 = OrderedSet.of('A', 'B', 'C'); - var s2 = OrderedSet.of('C', 'B', 'D'); - expect(s1.union(s2).toArray()).toEqual(['A','B','C','D']); - expect(s2.union(s1).toArray()).toEqual(['C','B','D','A']); + const s1 = OrderedSet.of('A', 'B', 'C'); + const s2 = OrderedSet.of('C', 'B', 'D'); + expect(s1.union(s2).toArray()).toEqual(['A', 'B', 'C', 'D']); + expect(s2.union(s1).toArray()).toEqual(['C', 'B', 'D', 'A']); }); + it('can be zipped', () => { + const s1 = OrderedSet.of('A', 'B', 'C'); + const s2 = OrderedSet.of('C', 'B', 'D'); + expect(s1.zip(s2).toArray()).toEqual([ + ['A', 'C'], + ['B', 'B'], + ['C', 'D'], + ]); + expect(s1.zipWith((c1, c2) => c1 + c2, s2).toArray()).toEqual([ + 'AC', + 'BB', + 'CD', + ]); + }); + + /** + * @see https://github.com/immutable-js/immutable-js/issues/1716 + */ + it('handles `subtract` when Set contains >=32 elements', () => { + const fillArray = (nb) => + Array(nb) + .fill(1) + .map((el, i) => i + 1); + + const capacity = 32; + // items from keys 0 to 31 and values 1 to 32 + const defaultItems = fillArray(capacity); + + const allItems = OrderedSet(defaultItems); + + const partialCapacity = Math.ceil(capacity / 2) + 1; + const someOfThem = fillArray(partialCapacity); + expect(someOfThem.length).toBe(17); + + const existingItems = OrderedSet(someOfThem).intersect(allItems); + + expect(allItems.subtract(existingItems).size).toBe(15); + expect(allItems.subtract(existingItems).size + someOfThem.length).toBe(32); + }); + + /** + * @see https://github.com/immutable-js/immutable-js/issues/1603 + */ + it('handles consecutive `subtract` invocations', () => { + let a = OrderedSet(); + let b = OrderedSet(); + let c; + let d; + // Set a to 0-45 + for (let i = 0; i < 46; i++) { + a = a.add(i); + } + // Set b to 0-24 + for (let i = 0; i < 25; i++) { + b = b.add(i); + } + // Set c to 0-23 + // eslint-disable-next-line prefer-const + c = b.butLast(); + + // Set d to 0-22 + // eslint-disable-next-line prefer-const + d = c.butLast(); + + // Internal list resizing happens on the final `subtract` when subtracting d from a + const aNotB = a.subtract(b); + const aNotC = a.subtract(c); + const aNotD = a.subtract(d); + + expect(aNotB.size).toBe(21); + expect(aNotC.size).toBe(22); + expect(aNotD.size).toBe(23); + }); + + it('keeps the Set ordered when updating a value with .map()', () => { + const first = Map({ id: 1, valid: true }); + const second = Map({ id: 2, valid: true }); + const third = Map({ id: 3, valid: true }); + const initial = OrderedSet([first, second, third]); + + const out = initial.map((t) => { + if (t.get('id') === 2) { + return t.set('valid', false); + } + return t; + }); + + const expected = OrderedSet([ + Map({ id: 1, valid: true }), + Map({ id: 2, valid: false }), + Map({ id: 3, valid: true }), + ]); + + expect(out).toEqual(expected); + + expect(out.has(first)).toBe(true); + expect(out.has(second)).toBe(false); + expect(out.has(third)).toBe(true); + }); + + it('hashCode should return the same value if the values are the same', () => { + const set1 = OrderedSet(['hello']); + const set2 = OrderedSet(['goodbye', 'hello']).remove('goodbye'); + + expect(set1.hashCode()).toBe(set2.hashCode()); + }); }); diff --git a/__tests__/Predicates.ts b/__tests__/Predicates.ts new file mode 100644 index 0000000000..0ab282205b --- /dev/null +++ b/__tests__/Predicates.ts @@ -0,0 +1,61 @@ +import { describe, expect, it } from '@jest/globals'; +import { + is, + isImmutable, + isValueObject, + List, + Map, + Set, + Stack, +} from 'immutable'; + +describe('isImmutable', () => { + it('behaves as advertised', () => { + expect(isImmutable([])).toBe(false); + expect(isImmutable({})).toBe(false); + expect(isImmutable(Map())).toBe(true); + expect(isImmutable(List())).toBe(true); + expect(isImmutable(Set())).toBe(true); + expect(isImmutable(Stack())).toBe(true); + expect(isImmutable(Map().asMutable())).toBe(true); + }); +}); + +describe('isValueObject', () => { + it('behaves as advertised', () => { + expect(isValueObject(null)).toBe(false); + expect(isValueObject(123)).toBe(false); + expect(isValueObject('abc')).toBe(false); + expect(isValueObject([])).toBe(false); + expect(isValueObject({})).toBe(false); + expect(isValueObject(Map())).toBe(true); + expect(isValueObject(List())).toBe(true); + expect(isValueObject(Set())).toBe(true); + expect(isValueObject(Stack())).toBe(true); + expect(isValueObject(Map().asMutable())).toBe(true); + }); + + it('works on custom types', () => { + class MyValueType { + v: number; + + constructor(val: number) { + this.v = val; + } + + equals(other) { + return Boolean(other && this.v === other.v); + } + + hashCode() { + return this.v; + } + } + + expect(isValueObject(new MyValueType(123))).toBe(true); + expect(is(new MyValueType(123), new MyValueType(123))).toBe(true); + expect(Set().add(new MyValueType(123)).add(new MyValueType(123)).size).toBe( + 1 + ); + }); +}); diff --git a/__tests__/Range.ts b/__tests__/Range.ts index 0d9ea2b279..94c096d1a8 100644 --- a/__tests__/Range.ts +++ b/__tests__/Range.ts @@ -1,59 +1,68 @@ -/// -/// - -jest.autoMockOff(); - -import jasmineCheck = require('jasmine-check'); -jasmineCheck.install(); - -import Immutable = require('immutable'); -import Range = Immutable.Range; +import { describe, expect, it } from '@jest/globals'; +import { Range } from 'immutable'; +import fc from 'fast-check'; describe('Range', () => { - it('fixed range', () => { - var v = Range(0, 3); + const v = Range(0, 3); expect(v.size).toBe(3); expect(v.first()).toBe(0); - expect(v.rest().toArray()).toEqual([1,2]); + expect(v.rest().toArray()).toEqual([1, 2]); expect(v.last()).toBe(2); - expect(v.butLast().toArray()).toEqual([0,1]); - expect(v.toArray()).toEqual([0,1,2]); + expect(v.butLast().toArray()).toEqual([0, 1]); + expect(v.toArray()).toEqual([0, 1, 2]); }); it('stepped range', () => { - var v = Range(1, 10, 3); + const v = Range(1, 10, 3); expect(v.size).toBe(3); expect(v.first()).toBe(1); - expect(v.rest().toArray()).toEqual([4,7]); + expect(v.rest().toArray()).toEqual([4, 7]); expect(v.last()).toBe(7); - expect(v.butLast().toArray()).toEqual([1,4]); - expect(v.toArray()).toEqual([1,4,7]); + expect(v.butLast().toArray()).toEqual([1, 4]); + expect(v.toArray()).toEqual([1, 4, 7]); + }); + + it('range should contain start and end values', () => { + // @ts-expect-error -- test that runtime error is thrown + expect(() => Range()).toThrow( + 'You must define a start value when using Range' + ); + // @ts-expect-error -- test that runtime error is thrown + expect(() => Range(1)).toThrow( + 'You must define an end value when using Range' + ); }); it('open range', () => { - var v = Range(10); + const v = Range(10, Infinity); expect(v.size).toBe(Infinity); expect(v.first()).toBe(10); expect(v.rest().first()).toBe(11); expect(v.last()).toBe(Infinity); expect(v.butLast().first()).toBe(10); expect(v.butLast().last()).toBe(Infinity); - expect(() => v.rest().toArray()).toThrow('Cannot perform this action with an infinite size.'); - expect(() => v.butLast().toArray()).toThrow('Cannot perform this action with an infinite size.'); - expect(() => v.toArray()).toThrow('Cannot perform this action with an infinite size.'); + expect(() => v.rest().toArray()).toThrow( + 'Cannot perform this action with an infinite size.' + ); + expect(() => v.butLast().toArray()).toThrow( + 'Cannot perform this action with an infinite size.' + ); + expect(() => v.toArray()).toThrow( + 'Cannot perform this action with an infinite size.' + ); }); it('backwards range', () => { - var v = Range(10, 1, 3); + const v = Range(10, 1, 3); expect(v.size).toBe(3); expect(v.first()).toBe(10); expect(v.last()).toBe(4); - expect(v.toArray()).toEqual([10,7,4]); + expect(v.toArray()).toEqual([10, 7, 4]); }); it('empty range', () => { - var v = Range(10, 10); + const v = Range(10, 10); expect(v.size).toBe(0); expect(v.first()).toBe(undefined); expect(v.rest().toArray()).toEqual([]); @@ -62,127 +71,162 @@ describe('Range', () => { expect(v.toArray()).toEqual([]); }); - check.it('includes first, excludes last', [gen.int, gen.int], function (from, to) { - var isIncreasing = to >= from; - var size = isIncreasing ? to - from : from - to; - var r = Range(from, to); - var a = r.toArray(); - expect(r.size).toBe(size); - expect(a.length).toBe(size); - expect(r.get(0)).toBe(size ? from : undefined); - expect(a[0]).toBe(size ? from : undefined); - var last = to + (isIncreasing ? -1 : 1); - expect(r.last()).toBe(size ? last : undefined); - if (size) { - expect(a[a.length - 1]).toBe(last); - } - }); - - var shrinkInt = gen.shrink(gen.int); - - check.it('slices the same as array slices', - [shrinkInt, shrinkInt, shrinkInt, shrinkInt], - function (from, to, begin, end) { - var r = Range(from, to); - var a = r.toArray(); - expect(r.slice(begin, end).toArray()).toEqual(a.slice(begin, end)); - } - ); + const shrinkInt = fc.integer({ min: -1000, max: 1000 }); + + it('includes first, excludes last', () => { + fc.assert( + fc.property(shrinkInt, shrinkInt, (from, to) => { + const isIncreasing = to >= from; + const size = isIncreasing ? to - from : from - to; + const r = Range(from, to); + const a = r.toArray(); + expect(r.size).toBe(size); + expect(a.length).toBe(size); + expect(r.get(0)).toBe(size ? from : undefined); + expect(a[0]).toBe(size ? from : undefined); + const last = to + (isIncreasing ? -1 : 1); + expect(r.last()).toBe(size ? last : undefined); + if (size) { + // eslint-disable-next-line jest/no-conditional-expect + expect(a[a.length - 1]).toBe(last); + } + }) + ); + }); + + it('slices the same as array slices', () => { + fc.assert( + fc.property( + shrinkInt, + shrinkInt, + shrinkInt, + shrinkInt, + (from, to, begin, end) => { + const r = Range(from, to); + const a = r.toArray(); + expect(r.slice(begin, end).toArray()).toEqual(a.slice(begin, end)); + } + ) + ); + }); it('slices range', () => { - var v = Range(1, 11, 2); - var s = v.slice(1, -2); + const v = Range(1, 11, 2); + const s = v.slice(1, -2); expect(s.size).toBe(2); - expect(s.toArray()).toEqual([3,5]); + expect(s.toArray()).toEqual([3, 5]); }); it('empty slice of range', () => { - var v = Range(1, 11, 2); - var s = v.slice(100, 200); + const v = Range(1, 11, 2); + const s = v.slice(100, 200); expect(s.size).toBe(0); expect(s.toArray()).toEqual([]); }); it('slices empty range', () => { - var v = Range(10, 10); - var s = v.slice(1, -2); + const v = Range(10, 10); + const s = v.slice(1, -2); expect(s.size).toBe(0); expect(s.toArray()).toEqual([]); }); it('stepped range does not land on end', () => { - var v = Range(0, 7, 2); + const v = Range(0, 7, 2); expect(v.size).toBe(4); - expect(v.toArray()).toEqual([0,2,4,6]); + expect(v.toArray()).toEqual([0, 2, 4, 6]); }); it('can be float', () => { - var v = Range(0.5, 2.5, 0.5); + const v = Range(0.5, 2.5, 0.5); expect(v.size).toBe(4); expect(v.toArray()).toEqual([0.5, 1, 1.5, 2]); }); it('can be negative', () => { - var v = Range(10, -10, 5); + const v = Range(10, -10, 5); expect(v.size).toBe(4); - expect(v.toArray()).toEqual([10,5,0,-5]); + expect(v.toArray()).toEqual([10, 5, 0, -5]); }); it('can get from any index in O(1)', () => { - var v = Range(0, Infinity, 8); + const v = Range(0, Infinity, 8); expect(v.get(111)).toBe(888); }); it('can find an index in O(1)', () => { - var v = Range(0, Infinity, 8); + const v = Range(0, Infinity, 8); expect(v.indexOf(888)).toBe(111); }); it('maps values', () => { - var r = Range(0, 4).map(v => v * v); - expect(r.toArray()).toEqual([0,1,4,9]); + const r = Range(0, 4).map((v) => v * v); + expect(r.toArray()).toEqual([0, 1, 4, 9]); }); it('filters values', () => { - var r = Range(0, 10).filter(v => v % 2 == 0); - expect(r.toArray()).toEqual([0,2,4,6,8]); + const r = Range(0, 10).filter((v) => v % 2 === 0); + expect(r.toArray()).toEqual([0, 2, 4, 6, 8]); }); - it('reduces values', () => { - var v = Range(0, 10, 2); - - var r = v.reduce((a, b) => a + b, 0); + it('partitions values', () => { + const r = Range(0, 10) + .partition((v) => v % 2 === 0) + .map((part) => part.toArray()); + expect(r).toEqual([ + [1, 3, 5, 7, 9], + [0, 2, 4, 6, 8], + ]); + }); + it('reduces values', () => { + const v = Range(0, 10, 2); + const r = v.reduce((a, b) => a + b, 0); expect(r).toEqual(20); }); it('takes and skips values', () => { - var v = Range(0, 100, 3) - - var r = v.skip(2).take(2); - + const v = Range(0, 100, 3); + const r = v.skip(2).take(2); expect(r.toArray()).toEqual([6, 9]); }); it('can describe lazy operations', () => { expect( - Range(1, Infinity).map(n => -n).take(5).toArray() - ).toEqual( - [ -1, -2, -3, -4, -5 ] - ); + Range(1, Infinity) + .map((n) => -n) + .take(5) + .toArray() + ).toEqual([-1, -2, -3, -4, -5]); }); it('efficiently chains array methods', () => { - var v = Range(1, Infinity); - - var r = v - .filter(x => x % 2 == 0) + const v = Range(1, Infinity); + const r = v + .filter((x) => x % 2 === 0) .skip(2) - .map(x => x * x) + .map((x) => x * x) .take(3) .reduce((a, b) => a + b, 0); expect(r).toEqual(200); }); + it('sliced sequence works even on filtered sequence', () => { + expect(Range(0, 3).slice(-2).toArray()).toEqual([1, 2]); + + expect( + Range(0, 3) + .filter(() => true) + .slice(-2) + .toArray() + ).toEqual([1, 2]); + }); + + it('toString', () => { + expect(Range(0, 0).toString()).toBe('Range []'); + expect(Range(0, 3).toString()).toBe('Range [ 0...3 ]'); + expect(Range(0, 10, 2).toString()).toBe('Range [ 0...10 by 2 ]'); + expect(Range(10, 0, -2).toString()).toBe('Range [ 10...0 by -2 ]'); + }); }); diff --git a/__tests__/Record.ts b/__tests__/Record.ts index 03d1b0d42f..3839b6c46b 100644 --- a/__tests__/Record.ts +++ b/__tests__/Record.ts @@ -1,65 +1,59 @@ -/// -/// - -jest.autoMockOff(); - -import Immutable = require('immutable'); -import Record = Immutable.Record; +import { describe, expect, it } from '@jest/globals'; +import { isKeyed, List, Map, Record, Seq } from 'immutable'; describe('Record', () => { - it('defines a constructor', () => { - var MyType = Record({a:1, b:2, c:3}); + const MyType = Record({ a: 1, b: 2, c: 3 }); - var t1 = new MyType(); - var t2 = t1.set('a', 10); - var t3 = t2.clear(); + const t1 = MyType(); + const t2 = t1.set('a', 10); expect(t1 instanceof Record).toBe(true); expect(t1 instanceof MyType).toBe(true); - expect(t3 instanceof Record).toBe(true); - expect(t3 instanceof MyType).toBe(true); + expect(t2 instanceof Record).toBe(true); + expect(t2 instanceof MyType).toBe(true); expect(t1.get('a')).toBe(1); expect(t2.get('a')).toBe(10); + }); + + it('allows for a descriptive name', () => { + const Person = Record({ name: null as string | null }, 'Person'); - expect(t1.size).toBe(3); - expect(t2.size).toBe(3); - }) + const me = Person({ name: 'My Name' }); + expect(me.toString()).toEqual('Person { name: "My Name" }'); + expect(Record.getDescriptiveName(me)).toEqual('Person'); + expect(Person.displayName).toBe('Person'); + }); it('passes through records of the same type', () => { - var P2 = Record({ x: 0, y: 0 }); - var P3 = Record({ x: 0, y: 0, z: 0 }); - var p2 = P2(); - var p3 = P3(); + const P2 = Record({ x: 0, y: 0 }); + const P3 = Record({ x: 0, y: 0, z: 0 }); + const p2 = P2(); + const p3 = P3(); expect(P3(p2) instanceof P3).toBe(true); expect(P2(p3) instanceof P2).toBe(true); expect(P2(p2)).toBe(p2); expect(P3(p3)).toBe(p3); - }) - - it('only allows setting what it knows about', () => { - var MyType = Record({a:1, b:2, c:3}); - - var t1 = new MyType({a: 10, b:20}); - expect(() => { - t1.set('d', 4); - }).toThrow('Cannot set unknown key "d" on Record'); }); - it('has a fixed size and falls back to default values', () => { - var MyType = Record({a:1, b:2, c:3}); + it('setting an unknown key is a no-op', () => { + const MyType = Record({ a: 1, b: 2, c: 3 }); - var t1 = new MyType({a: 10, b:20}); - var t2 = new MyType({b: 20}); - var t3 = t1.remove('a'); - var t4 = t3.clear(); + const t1 = MyType({ a: 10, b: 20 }); + // @ts-expect-error -- try to force an unknown value + const t2 = t1.set('d', 4); - expect(t1.size).toBe(3); - expect(t2.size).toBe(3); - expect(t3.size).toBe(3); - expect(t4.size).toBe(3); + expect(t2).toBe(t1); + }); + + it('falls back to default values when deleted or cleared', () => { + const MyType = Record({ a: 1, b: 2, c: 3 }); + const t1 = MyType({ a: 10, b: 20 }); + const t2 = MyType({ b: 20 }); + const t3 = t1.delete('a'); + const t4 = t3.clear(); expect(t1.get('a')).toBe(10); expect(t2.get('a')).toBe(1); @@ -68,31 +62,258 @@ describe('Record', () => { expect(t2.equals(t3)).toBe(true); expect(t2.equals(t4)).toBe(false); - expect(t4.equals(new MyType())).toBe(true); - }) + expect(t4.equals(MyType())).toBe(true); + }); + + it('allows deletion of values deep within a tree', () => { + const AType = Record({ a: 1 }); + const BType = Record({ b: AType({ a: 2 }) }); + const t1 = BType(); + const t2 = t1.deleteIn(['b', 'a']); + + expect(t1.get('b').get('a')).toBe(2); + expect(t2.get('b').get('a')).toBe(1); + }); + + it('is a value type and equals other similar Records', () => { + const MyType = Record({ a: 1, b: 2, c: 3 }); + const t1 = MyType({ a: 10 }); + const t2 = MyType({ a: 10, b: 2 }); + expect(t1.equals(t2)).toBe(true); + }); + + it('if compared against undefined or null should return false', () => { + const MyType = Record({ a: 1, b: 2 }); + const t1 = MyType(); + expect(t1.equals(undefined)).toBeFalsy(); + expect(t1.equals(null)).toBeFalsy(); + }); + + it('if compared against Map should return false', () => { + const MyType = Record({ a: 1, b: 2 }); + const t1 = MyType(); + expect(t1.equals(Map({ a: 1, b: 2 }))).toBeFalsy(); + }); + + it('merges in Objects and other Records', () => { + const Point2 = Record({ x: 0, y: 0 }); + const Point3 = Record({ x: 0, y: 0, z: 0 }); + + const p2 = Point2({ x: 20, y: 20 }); + const p3 = Point3({ x: 10, y: 10, z: 10 }); + + expect(p3.merge(p2).toObject()).toEqual({ x: 20, y: 20, z: 10 }); + + expect(p2.merge({ y: 30 }).toObject()).toEqual({ x: 20, y: 30 }); + expect(p3.merge({ y: 30, z: 30 }).toObject()).toEqual({ + x: 10, + y: 30, + z: 30, + }); + }); it('converts sequences to records', () => { - var MyType = Record({a:1, b:2, c:3}); - var seq = Immutable.Seq({a: 10, b:20}); - var t = new MyType(seq); - expect(t.toObject()).toEqual({a:10, b:20, c:3}) - }) + const MyType = Record({ a: 1, b: 2, c: 3 }); + const seq = Seq({ a: 10, b: 20 }); + const t = MyType(seq); + expect(t.toObject()).toEqual({ a: 10, b: 20, c: 3 }); + }); it('allows for functional construction', () => { - var MyType = Record({a:1, b:2, c:3}); - var seq = Immutable.Seq({a: 10, b:20}); - var t = MyType(seq); - expect(t.toObject()).toEqual({a:10, b:20, c:3}) - }) + const MyType = Record({ a: 1, b: 2, c: 3 }); + const seq = Seq({ a: 10, b: 20 }); + const t = MyType(seq); + expect(t.toObject()).toEqual({ a: 10, b: 20, c: 3 }); + }); it('skips unknown keys', () => { - var MyType = Record({a:1, b:2}); - var seq = Immutable.Seq({b:20, c:30}); - var t = new MyType(seq); + const MyType = Record({ a: 1, b: 2 }); + const seq = Seq({ b: 20, c: 30 }); + const t = MyType(seq); expect(t.get('a')).toEqual(1); expect(t.get('b')).toEqual(20); + // @ts-expect-error -- unknown key should not return anything expect(t.get('c')).toBeUndefined(); - }) + }); + + it('returns itself when setting identical values', () => { + const MyType = Record({ a: 1, b: 2 }); + const t1 = MyType(); + const t2 = MyType({ a: 1 }); + const t3 = t1.set('a', 1); + const t4 = t2.set('a', 1); + expect(t3).toBe(t1); + expect(t4).toBe(t2); + }); + + it('returns record when setting values', () => { + const MyType = Record({ a: 1, b: 2 }); + const t1 = MyType(); + const t2 = MyType({ a: 1 }); + const t3 = t1.set('a', 3); + const t4 = t2.set('a', 3); + expect(t3).not.toBe(t1); + expect(t4).not.toBe(t2); + }); + + it('allows for readonly property access', () => { + const MyType = Record({ a: 1, b: 'foo' }); + const t1 = MyType(); + const a: number = t1.a; + const b: string = t1.b; + expect(a).toEqual(1); + expect(b).toEqual('foo'); + // @ts-expect-error -- test that runtime does throw + expect(() => (t1.a = 2)).toThrow('Cannot set on an immutable record.'); + }); + + it('allows for class extension', () => { + class ABClass extends Record({ a: 1, b: 2 }) { + setA(aVal: number) { + return this.set('a', aVal); + } + + setB(bVal: number) { + return this.set('b', bVal); + } + } + // Note: `new` is only used because of `class` + const t1 = new ABClass({ a: 1 }); + const t2 = t1.setA(3); + const t3 = t2.setB(10); + + const a: number = t3.a; + expect(a).toEqual(3); + expect(t3.toObject()).toEqual({ a: 3, b: 10 }); + }); + + it('does not allow overwriting property names', () => { + const realWarn = console.warn; + + try { + const warnings: Array = []; + + console.warn = (w) => warnings.push(w); + + // size is a safe key to use + const MyType1 = Record({ size: 123 }); + const t1 = MyType1(); + expect(warnings.length).toBe(0); + expect(t1.size).toBe(123); + + // get() is not safe to use + const MyType2 = Record({ get: 0 }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const t2 = MyType2(); + expect(warnings.length).toBe(1); + expect(warnings[0]).toBe( + 'Cannot define Record with property "get" since that property name is part of the Record API.' + ); + } finally { + console.warn = realWarn; + } + }); + + it('can be converted to a keyed sequence', () => { + const MyType = Record({ a: 0, b: 0 }); + const t1 = MyType({ a: 10, b: 20 }); + + const seq1 = t1.toSeq(); + expect(isKeyed(seq1)).toBe(true); + expect(seq1.toJS()).toEqual({ a: 10, b: 20 }); + + const seq2 = Seq(t1); + expect(isKeyed(seq2)).toBe(true); + expect(seq2.toJS()).toEqual({ a: 10, b: 20 }); + + const seq3 = Seq.Keyed(t1); + expect(isKeyed(seq3)).toBe(true); + expect(seq3.toJS()).toEqual({ a: 10, b: 20 }); + + const seq4 = Seq.Indexed(t1); + expect(isKeyed(seq4)).toBe(false); + expect(seq4.toJS()).toEqual([ + ['a', 10], + ['b', 20], + ]); + }); + + it('can be iterated over', () => { + const MyType = Record({ a: 0, b: 0 }); + const t1 = MyType({ a: 10, b: 20 }); + + const entries: Array<[string, number]> = []; + for (const entry of t1) { + entries.push(entry); + } + + expect(entries).toEqual([ + ['a', 10], + ['b', 20], + ]); + }); + + it('calling `equals` between two instance of factories with same properties and same value should return true', () => { + const factoryA = Record({ id: '' }); + const factoryB = Record({ id: '' }); + + expect(factoryA().equals(factoryA())).toBe(true); + expect(factoryA().equals(factoryB())).toBe(true); + }); + + /** + * @see https://github.com/immutable-js/immutable-js/issues/1565 + */ + it('check that reset does reset the record.', () => { + type UserType = { + name: string; + roles: List | Array; + }; + + const User = Record({ + name: 'default name', + roles: List(), + }); + + const user0 = new User({ + name: 'John', + roles: ['superuser', 'admin'], + }); + const user1 = user0.clear(); + + expect(user1.name).toBe('default name'); + expect(user1.roles).toEqual(List()); + + const user2 = user0.withMutations((mutable: Record) => { + mutable.clear(); + }); + + expect(user2.name).toBe('default name'); + expect(user2.roles).toEqual(List()); + }); + + it('does not accept a Record as constructor', () => { + const Foo = Record({ foo: 'bar' }); + const fooInstance = Foo(); + expect(() => { + Record(fooInstance); + }).toThrowErrorMatchingSnapshot(); + }); + + it('does not accept a non object as constructor', () => { + const defaultValues = null; + expect(() => { + // @ts-expect-error -- test that runtime does throw + Record(defaultValues); + }).toThrowErrorMatchingSnapshot(); + }); + + it('does not accept an immutable object that is not a Record as constructor', () => { + const defaultValues = Map({ foo: 'bar' }); + expect(() => { + Record(defaultValues); + }).toThrowErrorMatchingSnapshot(); + }); }); diff --git a/__tests__/RecordJS.js b/__tests__/RecordJS.js index c45e6b2b6d..3ae53fb878 100644 --- a/__tests__/RecordJS.js +++ b/__tests__/RecordJS.js @@ -1,28 +1,27 @@ -jest.autoMockOff(); - -var Immutable = require('immutable'); -var Record = Immutable.Record; +import { describe, expect, it } from '@jest/globals'; +import { Record } from 'immutable'; describe('Record', () => { + it('defines a record factory', () => { + const MyType = Record({ a: 1, b: 2, c: 3 }); - it('defines a constructor', () => { - var MyType = Record({a:1, b:2, c:3}); - - var t = new MyType(); - var t2 = t.set('a', 10); + const t = MyType(); + const t2 = t.set('a', 10); expect(t.a).toBe(1); expect(t2.a).toBe(10); }); it('can have mutations apply', () => { - var MyType = Record({a:1, b:2, c:3}); + const MyType = Record({ a: 1, b: 2, c: 3 }); - var t = new MyType(); + const t = MyType(); - expect(() => { t.a = 10; }).toThrow(); + expect(() => { + t.a = 10; + }).toThrow(); - var t2 = t.withMutations(mt => { + const t2 = t.withMutations((mt) => { mt.a = 10; mt.b = 20; mt.c = 30; @@ -33,32 +32,40 @@ describe('Record', () => { }); it('can be subclassed', () => { - - class Alphabet extends Record({a:1, b:2, c:3}) { + class Alphabet extends Record({ a: 1, b: 2, c: 3 }) { soup() { return this.a + this.b + this.c; } } - var t = new Alphabet(); - var t2 = t.set('b', 200); + // Note: `new` is only used because of `class` + const t = new Alphabet(); + const t2 = t.set('b', 200); - expect(t instanceof Record); - expect(t instanceof Alphabet); + expect(t instanceof Record).toBe(true); + expect(t instanceof Alphabet).toBe(true); expect(t.soup()).toBe(6); expect(t2.soup()).toBe(204); + + // Uses class name as descriptive name + expect(Record.getDescriptiveName(t)).toBe('Alphabet'); + + // Uses display name over class name + class NotADisplayName extends Record({ x: 1 }, 'DisplayName') {} + const t3 = new NotADisplayName(); + expect(Record.getDescriptiveName(t3)).toBe('DisplayName'); }); it('can be cleared', () => { - var MyType = Record({a:1, b:2, c:3}); - var t = new MyType({c:'cats'}); + const MyType = Record({ a: 1, b: 2, c: 3 }); + let t = MyType({ c: 'cats' }); expect(t.c).toBe('cats'); t = t.clear(); expect(t.c).toBe(3); - var MyType2 = Record({d:4, e:5, f:6}); - var t2 = new MyType2({d:'dogs'}); + const MyType2 = Record({ d: 4, e: 5, f: 6 }); + let t2 = MyType2({ d: 'dogs' }); expect(t2.d).toBe('dogs'); t2 = t2.clear(); diff --git a/__tests__/Repeat.ts b/__tests__/Repeat.ts index ceefc1b44c..1553232ba5 100644 --- a/__tests__/Repeat.ts +++ b/__tests__/Repeat.ts @@ -1,22 +1,19 @@ -/// -/// - -jest.autoMockOff(); - -import Immutable = require('immutable'); -import Repeat = Immutable.Repeat; +import { describe, expect, it } from '@jest/globals'; +import { Repeat } from 'immutable'; describe('Repeat', () => { - it('fixed repeat', () => { - var v = Repeat('wtf', 3); + const v = Repeat('wtf', 3); expect(v.size).toBe(3); expect(v.first()).toBe('wtf'); - expect(v.rest().toArray()).toEqual(['wtf','wtf']); + expect(v.rest().toArray()).toEqual(['wtf', 'wtf']); expect(v.last()).toBe('wtf'); - expect(v.butLast().toArray()).toEqual(['wtf','wtf']); - expect(v.toArray()).toEqual(['wtf','wtf','wtf']); + expect(v.butLast().toArray()).toEqual(['wtf', 'wtf']); + expect(v.toArray()).toEqual(['wtf', 'wtf', 'wtf']); expect(v.join()).toEqual('wtf,wtf,wtf'); }); + it('does not claim to be equal to undefined', () => { + expect(Repeat(1).equals(undefined)).toEqual(false); + }); }); diff --git a/__tests__/Seq.ts b/__tests__/Seq.ts index 97095474ef..cbb048eb8b 100644 --- a/__tests__/Seq.ts +++ b/__tests__/Seq.ts @@ -1,26 +1,41 @@ -/// -/// +import { describe, expect, it } from '@jest/globals'; +import { isCollection, isIndexed, isKeyed, Seq } from 'immutable'; -jest.autoMockOff(); +describe('Seq', () => { + it('returns undefined if empty and first is called without default argument', () => { + expect(Seq().first()).toBeUndefined(); + }); -import Immutable = require('immutable'); + it('returns undefined if empty and last is called without default argument', () => { + expect(Seq().last()).toBeUndefined(); + }); -describe('Seq', () => { + it('returns default value if empty and first is called with default argument', () => { + expect(Seq().first({})).toEqual({}); + }); + + it('returns default value if empty and last is called with default argument', () => { + expect(Seq().last({})).toEqual({}); + }); it('can be empty', () => { - expect(Immutable.Seq().size).toBe(0); + expect(Seq().size).toBe(0); }); it('accepts an array', () => { - expect(Immutable.Seq([1,2,3]).size).toBe(3); + expect(Seq([1, 2, 3]).size).toBe(3); }); it('accepts an object', () => { - expect(Immutable.Seq({a:1,b:2,c:3}).size).toBe(3); + expect(Seq({ a: 1, b: 2, c: 3 }).size).toBe(3); }); - it('accepts an iterable string', () => { - expect(Immutable.Seq('foo').size).toBe(3); + it('accepts an object with a next property', () => { + expect(Seq({ a: 1, b: 2, next: (_) => _ }).size).toBe(3); + }); + + it('accepts a collection string', () => { + expect(Seq('foo').size).toBe(3); }); it('accepts arbitrary objects', () => { @@ -28,60 +43,100 @@ describe('Seq', () => { this.bar = 'bar'; this.baz = 'baz'; } - expect(Immutable.Seq(new Foo()).size).toBe(2); - }); - - it('of accepts varargs', () => { - expect(Immutable.Seq.of(1,2,3).size).toBe(3); + expect(Seq(new Foo()).size).toBe(2); }); it('accepts another sequence', () => { - var seq = Immutable.Seq.of(1,2,3); - expect(Immutable.Seq(seq).size).toBe(3); + const seq = Seq([1, 2, 3]); + expect(Seq(seq).size).toBe(3); }); it('accepts a string', () => { - var seq = Immutable.Seq('abc'); + const seq = Seq('abc'); expect(seq.size).toBe(3); expect(seq.get(1)).toBe('b'); expect(seq.join('')).toBe('abc'); }); it('accepts an array-like', () => { - var alike = { length: 2, 0: 'a', 1: 'b' }; - var seq = Immutable.Seq(alike); - expect(Immutable.Iterable.isIndexed(seq)).toBe(true); + const seq = Seq({ length: 2, 0: 'a', 1: 'b' }); + expect(isIndexed(seq)).toBe(true); expect(seq.size).toBe(2); expect(seq.get(1)).toBe('b'); + + const map = Seq({ length: 1, foo: 'bar' }); + expect(isIndexed(map)).toBe(false); + expect(map.size).toBe(2); + expect(map.get('foo')).toBe('bar'); + + const empty = Seq({ length: 0 }); + expect(isIndexed(empty)).toBe(true); + expect(empty.size).toEqual(0); }); - it('does not accept a scalar', () => { - expect(() => { - Immutable.Seq(3); - }).toThrow('Expected Array or iterable object of values, or keyed object: 3'); + it('accepts a JS (global) Map', () => { + const seq = Seq( + new global.Map([ + ['a', 'A'], + ['b', 'B'], + ['c', 'C'], + ]) + ); + expect(isKeyed(seq)).toBe(true); + expect(seq.size).toBe(3); }); - it('temporarily warns about iterable length', function () { - this.spyOn(console, 'warn'); + it('accepts a JS (global) Set', () => { + const seq = Seq(new global.Set(['a', 'b', 'c'])); + expect(isIndexed(seq)).toBe(false); + expect(isKeyed(seq)).toBe(false); + expect(seq.size).toBe(3); + }); - var seq = Immutable.Seq.of(1,2,3); + it('does not accept a scalar', () => { + expect(() => { + // @ts-expect-error -- test that runtime does throw + Seq(3); + }).toThrow( + 'Expected Array or collection object of values, or keyed object: 3' + ); + }); - // Note: `length` has been removed from the type definitions. - var length = (seq).length; + it('detects sequences', () => { + const seq = Seq([1, 2, 3]); + expect(Seq.isSeq(seq)).toBe(true); + expect(isCollection(seq)).toBe(true); + }); - expect((console).warn.mostRecentCall.args[0]).toContain( - 'iterable.length has been deprecated, '+ - 'use iterable.size or iterable.count(). '+ - 'This warning will become a silent error in a future version.' - ); + it('Does not infinite loop when sliced with NaN', () => { + const list = Seq([1, 2, 3, 4, 5]); + expect(list.slice(0, NaN).toJS()).toEqual([]); + expect(list.slice(NaN).toJS()).toEqual([1, 2, 3, 4, 5]); + }); - expect(length).toBe(3); + it('Does not infinite loop when spliced with negative number #559', () => { + const dog = Seq(['d', 'o', 'g']); + const dg = dog.filter((c) => c !== 'o'); + const dig = dg.splice(-1, 0, 'i'); + expect(dig.toJS()).toEqual(['d', 'i', 'g']); }); - it('detects sequences', () => { - var seq = Immutable.Seq.of(1,2,3); - expect(Immutable.Seq.isSeq(seq)).toBe(true); - expect(Immutable.Iterable.isIterable(seq)).toBe(true); + it('Does not infinite loop when an undefined number is passed to take', () => { + const list = Seq([1, 2, 3, 4, 5]); + expect(list.take(NaN).toJS()).toEqual([]); }); + it('Converts deeply toJS after converting to entries', () => { + const list = Seq([Seq([1, 2]), Seq({ a: 'z' })]); + expect(list.entrySeq().toJS()).toEqual([ + [0, [1, 2]], + [1, { a: 'z' }], + ]); + + const map = Seq({ x: Seq([1, 2]), y: Seq({ a: 'z' }) }); + expect(map.entrySeq().toJS()).toEqual([ + ['x', [1, 2]], + ['y', { a: 'z' }], + ]); + }); }); diff --git a/__tests__/Set.ts b/__tests__/Set.ts index 1db36bc905..5e8f1fe5d7 100644 --- a/__tests__/Set.ts +++ b/__tests__/Set.ts @@ -1,30 +1,9 @@ -/// -/// - -jest.autoMockOff(); - -import Immutable = require('immutable'); -import Set = Immutable.Set; - -declare function expect(val: any): ExpectWithIs; - -interface ExpectWithIs extends Expect { - is(expected: any): void; - not: ExpectWithIs; -} +import { describe, expect, it, jest } from '@jest/globals'; +import { fromJS, is, List, Map, OrderedSet, Seq, Set } from 'immutable'; describe('Set', () => { - - beforeEach(function () { - this.addMatchers({ - is: function(expected) { - return Immutable.is(this.actual, expected); - } - }) - }) - it('accepts array of values', () => { - var s = Set([1,2,3]); + const s = Set([1, 2, 3]); expect(s.has(1)).toBe(true); expect(s.has(2)).toBe(true); expect(s.has(3)).toBe(true); @@ -32,16 +11,26 @@ describe('Set', () => { }); it('accepts array-like of values', () => { - var s = Set({ 'length': 3, '1': 2 }); - expect(s.size).toBe(2) + const s = Set({ length: 3, 2: 3 }); + expect(s.size).toBe(2); expect(s.has(undefined)).toBe(true); + expect(s.has(3)).toBe(true); + expect(s.has(2)).toBe(false); + }); + + it('accepts a JS (global) Set', () => { + const s = Set(new global.Set([1, 2, 3])); + expect(Set.isSet(s)).toBe(true); + expect(s.size).toBe(3); + expect(s.has(1)).toBe(true); expect(s.has(2)).toBe(true); - expect(s.has(1)).toBe(false); + expect(s.has(3)).toBe(true); + expect(s.has(4)).toBe(false); }); - it('accepts string, an array-like iterable', () => { - var s = Set('abc'); - expect(s.size).toBe(3) + it('accepts string, an array-like collection', () => { + const s = Set('abc'); + expect(s.size).toBe(3); expect(s.has('a')).toBe(true); expect(s.has('b')).toBe(true); expect(s.has('c')).toBe(true); @@ -49,8 +38,8 @@ describe('Set', () => { }); it('accepts sequence of values', () => { - var seq = Immutable.Seq.of(1,2,3); - var s = Set(seq); + const seq = Seq([1, 2, 3]); + const s = Set(seq); expect(s.has(1)).toBe(true); expect(s.has(2)).toBe(true); expect(s.has(3)).toBe(true); @@ -58,19 +47,23 @@ describe('Set', () => { }); it('accepts a keyed Seq as a set of entries', () => { - var seq = Immutable.Seq({a:null, b:null, c:null}).flip(); - var s = Set(seq); - expect(s.toArray()).toEqual([[null,'a'], [null,'b'], [null,'c']]); + const seq = Seq({ a: null, b: null, c: null }).flip(); + const s = Set(seq); + expect(s.toArray()).toEqual([ + [null, 'a'], + [null, 'b'], + [null, 'c'], + ]); // Explicitly getting the values sequence - var s2 = Set(seq.valueSeq()); - expect(s2.toArray()).toEqual(['a','b','c']); + const s2 = Set(seq.valueSeq()); + expect(s2.toArray()).toEqual(['a', 'b', 'c']); // toSet() does this for you. - var v3 = seq.toSet(); + const v3 = seq.toSet(); expect(v3.toArray()).toEqual(['a', 'b', 'c']); }); it('accepts object keys', () => { - var s = Set.fromKeys({a:null, b:null, c:null}); + const s = Set.fromKeys({ a: null, b: null, c: null }); expect(s.has('a')).toBe(true); expect(s.has('b')).toBe(true); expect(s.has('c')).toBe(true); @@ -78,8 +71,8 @@ describe('Set', () => { }); it('accepts sequence keys', () => { - var seq = Immutable.Seq({a:null, b:null, c:null}); - var s = Set.fromKeys(seq); + const seq = Seq({ a: null, b: null, c: null }); + const s = Set.fromKeys(seq); expect(s.has('a')).toBe(true); expect(s.has('b')).toBe(true); expect(s.has('c')).toBe(true); @@ -87,7 +80,7 @@ describe('Set', () => { }); it('accepts explicit values', () => { - var s = Set.of(1,2,3); + const s = Set([1, 2, 3]); expect(s.has(1)).toBe(true); expect(s.has(2)).toBe(true); expect(s.has(3)).toBe(true); @@ -95,53 +88,114 @@ describe('Set', () => { }); it('converts back to JS array', () => { - var s = Set.of(1,2,3); - expect(s.toArray()).toEqual([1,2,3]); + const s = Set([1, 2, 3]); + expect(s.toArray()).toEqual([1, 2, 3]); }); it('converts back to JS object', () => { - var s = Set.of('a','b','c'); - expect(s.toObject()).toEqual({a:'a',b:'b',c:'c'}); + const s = Set.of('a', 'b', 'c'); + expect(s.toObject()).toEqual({ a: 'a', b: 'b', c: 'c' }); + }); + + it('maps no-ops return the same reference', () => { + const s = Set([1, 2, 3]); + const r = s.map((value) => value); + expect(r).toBe(s); + }); + + it('maps should produce new set if values changed', () => { + const s = Set([1, 2, 3]); + expect(s.has(4)).toBe(false); + expect(s.size).toBe(3); + + const m = s.map((v) => v + 1); + expect(m.has(1)).toBe(false); + expect(m.has(2)).toBe(true); + expect(m.has(3)).toBe(true); + expect(m.has(4)).toBe(true); + expect(m.size).toBe(3); + }); + + it('unions an unknown collection of Sets', () => { + const abc = Set(['a', 'b', 'c']); + const cat = Set(['c', 'a', 't']); + expect(Set.union([abc, cat]).toArray()).toEqual(['c', 'a', 't', 'b']); + expect(Set.union([abc])).toBe(abc); + expect(Set.union([])).toBe(Set()); + }); + + it('intersects an unknown collection of Sets', () => { + const abc = Set(['a', 'b', 'c']); + const cat = Set(['c', 'a', 't']); + expect(Set.intersect([abc, cat]).toArray()).toEqual(['c', 'a']); + expect(Set.intersect([abc])).toBe(abc); + expect(Set.intersect([])).toBe(Set()); + }); + + it('concatenates strings using union', () => { + const s = Set(['one', 'two']); + expect(s.union('three').toArray()).toEqual(['one', 'two', 'three']); }); it('iterates values', () => { - var s = Set.of(1,2,3); - var iterator = jest.genMockFunction(); + const s = Set([1, 2, 3]); + const iterator = jest.fn(); s.forEach(iterator); expect(iterator.mock.calls).toEqual([ [1, 1, s], [2, 2, s], - [3, 3, s] + [3, 3, s], ]); }); + it('has the same iterator function for keys and values', () => { + const s = Set([1, 2, 3]); + expect(s[Symbol.iterator]).toBe(s.keys); + expect(s[Symbol.iterator]).toBe(s.values); + }); + it('unions two sets', () => { - var s1 = Set.of('a', 'b', 'c'); - var s2 = Set.of('d', 'b', 'wow'); - var s3 = s1.union(s2); + const s1 = Set.of('a', 'b', 'c'); + const s2 = Set.of('d', 'b', 'wow'); + const s3 = s1.union(s2); expect(s3.toArray()).toEqual(['a', 'b', 'c', 'd', 'wow']); }); it('returns self when union results in no-op', () => { - var s1 = Set.of('a', 'b', 'c'); - var s2 = Set.of('c', 'a'); - var s3 = s1.union(s2); + const s1 = Set.of('a', 'b', 'c'); + const s2 = Set.of('c', 'a'); + const s3 = s1.union(s2); expect(s3).toBe(s1); }); it('returns arg when union results in no-op', () => { - var s1 = Set(); - var s2 = Set.of('a', 'b', 'c'); - var s3 = s1.union(s2); + const s1 = Set(); + const s2 = Set.of('a', 'b', 'c'); + const s3 = s1.union(s2); expect(s3).toBe(s2); }); + it('unions a set and another collection and returns a set', () => { + const s1 = Set([1, 2, 3]); + const emptySet = Set(); + const l = List([1, 2, 3]); + const s2 = s1.union(l); + const s3 = emptySet.union(l); + const o = OrderedSet([1, 2, 3]); + const s4 = s1.union(o); + const s5 = emptySet.union(o); + expect(Set.isSet(s2)).toBe(true); + expect(Set.isSet(s3)).toBe(true); + expect(Set.isSet(s4) && !OrderedSet.isOrderedSet(s4)).toBe(true); + expect(Set.isSet(s5) && !OrderedSet.isOrderedSet(s5)).toBe(true); + }); + it('is persistent to adds', () => { - var s1 = Set(); - var s2 = s1.add('a'); - var s3 = s2.add('b'); - var s4 = s3.add('c'); - var s5 = s4.add('b'); + const s1 = Set(); + const s2 = s1.add('a'); + const s3 = s2.add('b'); + const s4 = s3.add('c'); + const s5 = s4.add('b'); expect(s1.size).toBe(0); expect(s2.size).toBe(1); expect(s3.size).toBe(2); @@ -150,11 +204,11 @@ describe('Set', () => { }); it('is persistent to deletes', () => { - var s1 = Set(); - var s2 = s1.add('a'); - var s3 = s2.add('b'); - var s4 = s3.add('c'); - var s5 = s4.remove('b'); + const s1 = Set(); + const s2 = s1.add('a'); + const s3 = s2.add('b'); + const s4 = s3.add('c'); + const s5 = s4.remove('b'); expect(s1.size).toBe(0); expect(s2.size).toBe(1); expect(s3.size).toBe(2); @@ -165,47 +219,159 @@ describe('Set', () => { }); it('deletes down to empty set', () => { - var s = Set.of('A').remove('A'); + const s = Set.of('A').remove('A'); expect(s).toBe(Set()); }); it('unions multiple sets', () => { - var s = Set.of('A', 'B', 'C').union(Set.of('C', 'D', 'E'), Set.of('D', 'B', 'F')); - expect(s).is(Set.of('A','B','C','D','E','F')); + const s = Set.of('A', 'B', 'C').union( + Set.of('C', 'D', 'E'), + Set.of('D', 'B', 'F') + ); + expect(s).toEqual(Set.of('A', 'B', 'C', 'D', 'E', 'F')); }); it('intersects multiple sets', () => { - var s = Set.of('A', 'B', 'C').intersect(Set.of('B', 'C', 'D'), Set.of('A', 'C', 'E')); - expect(s).is(Set.of('C')); + const s = Set.of('A', 'B', 'C').intersect( + Set.of('B', 'C', 'D'), + Set.of('A', 'C', 'E') + ); + expect(s).toEqual(Set.of('C')); }); it('diffs multiple sets', () => { - var s = Set.of('A', 'B', 'C').subtract(Set.of('C', 'D', 'E'), Set.of('D', 'B', 'F')); - expect(s).is(Set.of('A')); + const s = Set.of('A', 'B', 'C').subtract( + Set.of('C', 'D', 'E'), + Set.of('D', 'B', 'F') + ); + expect(s).toEqual(Set.of('A')); }); it('expresses value equality with set sequences', () => { - var s1 = Set.of('A', 'B', 'C'); + const s1 = Set.of('A', 'B', 'C'); expect(s1.equals(null)).toBe(false); - var s2 = Set.of('C', 'B', 'A'); + const s2 = Set.of('C', 'B', 'A'); expect(s1 === s2).toBe(false); - expect(Immutable.is(s1, s2)).toBe(true); + expect(is(s1, s2)).toBe(true); expect(s1.equals(s2)).toBe(true); // Map and Set are not the same (keyed vs unkeyed) - var v1 = Immutable.Map({ A: 'A', C: 'C', B: 'B' }); - expect(Immutable.is(s1, v1)).toBe(false); + const v1 = Map({ A: 'A', C: 'C', B: 'B' }); + expect(is(s1, v1)).toBe(false); }); it('can use union in a withMutation', () => { - var js = Immutable.Set().withMutations(set => { - set.union([ 'a' ]); - set.add('b'); - }).toJS(); + const js = Set() + .withMutations((set) => { + set.union(['a']); + set.add('b'); + }) + .toJS(); expect(js).toEqual(['a', 'b']); }); - // TODO: more tests + it('can determine if an array is a subset', () => { + const s = Set.of('A', 'B', 'C'); + expect(s.isSuperset(['B', 'C'])).toBe(true); + expect(s.isSuperset(['B', 'C', 'D'])).toBe(false); + }); + + describe('accepts Symbol as entry #579', () => { + it('operates on small number of symbols, preserving set uniqueness', () => { + const a = Symbol(); + + const b = Symbol(); + + const c = Symbol(); + + const symbolSet = Set([a, b, c, a, b, c, a, b, c, a, b, c]); + expect(symbolSet.size).toBe(3); + expect(symbolSet.has(b)).toBe(true); + expect(symbolSet.get(c)).toEqual(c); + }); + + it('operates on a large number of symbols, maintaining obj uniqueness', () => { + const manySymbols = [ + Symbol('a'), + Symbol('b'), + Symbol('c'), + Symbol('a'), + Symbol('b'), + Symbol('c'), + Symbol('a'), + Symbol('b'), + Symbol('c'), + Symbol('a'), + Symbol('b'), + Symbol('c'), + ]; + + const symbolSet = Set(manySymbols); + expect(symbolSet.size).toBe(12); + expect(symbolSet.has(manySymbols[10])).toBe(true); + expect(symbolSet.get(manySymbols[10])).toEqual(manySymbols[10]); + }); + }); + it('can use intersect after add or union in a withMutation', () => { + const set = Set(['a', 'd']).withMutations((s) => { + s.add('b'); + s.union(['c']); + s.intersect(['b', 'c', 'd']); + }); + expect(set.toArray()).toEqual(['c', 'd', 'b']); + }); + + it('can count entries that satisfy a predicate', () => { + const set = Set([1, 2, 3, 4, 5]); + expect(set.size).toEqual(5); + expect(set.count()).toEqual(5); + expect(set.count((x) => x % 2 === 0)).toEqual(2); + expect(set.count(() => true)).toEqual(5); + }); + + describe('"size" should correctly reflect the number of elements in a Set', () => { + describe('deduplicating custom classes that invoke fromJS() as part of equality check', () => { + class Entity { + entityId: string; + + entityKey: string; + + constructor(entityId: string, entityKey: string) { + this.entityId = entityId; + this.entityKey = entityKey; + } + + asImmutable() { + return fromJS({ + entityId: this.entityId, + entityKey: this.entityKey, + }); + } + + valueOf() { + return this.asImmutable().toString(); + } + } + it('with mutations', () => { + const testSet = Set().withMutations((mutableSet) => { + mutableSet.add(new Entity('hello', 'world')); + mutableSet.add(new Entity('testing', 'immutable')); + mutableSet.add(new Entity('hello', 'world')); + }); + expect(testSet.size).toEqual(2); + }); + it('without mutations', () => { + const testSet0 = Set(); + const testSet1 = testSet0.add(new Entity('hello', 'world')); + const testSet2 = testSet1.add(new Entity('testing', 'immutable')); + const testSet3 = testSet2.add(new Entity('hello', 'world')); + expect(testSet0.size).toEqual(0); + expect(testSet1.size).toEqual(1); + expect(testSet2.size).toEqual(2); + expect(testSet3.size).toEqual(2); + }); + }); + }); }); diff --git a/__tests__/Stack.ts b/__tests__/Stack.ts index 32d13551f9..f3fc3d9326 100644 --- a/__tests__/Stack.ts +++ b/__tests__/Stack.ts @@ -1,188 +1,222 @@ -/// -/// - -jest.autoMockOff(); - -import jasmineCheck = require('jasmine-check'); -jasmineCheck.install(); - -import Immutable = require('immutable'); -import Stack = Immutable.Stack; +import { describe, expect, it } from '@jest/globals'; +import { Seq, Stack } from 'immutable'; +import fc from 'fast-check'; function arrayOfSize(s) { - var a = new Array(s); - for (var ii = 0; ii < s; ii++) { + const a = new Array(s); + for (let ii = 0; ii < s; ii++) { a[ii] = ii; } return a; } describe('Stack', () => { - it('constructor provides initial values', () => { - var s = Stack.of('a', 'b', 'c'); + const s = Stack.of('a', 'b', 'c'); expect(s.get(0)).toBe('a'); expect(s.get(1)).toBe('b'); expect(s.get(2)).toBe('c'); }); it('toArray provides a JS array', () => { - var s = Stack.of('a', 'b', 'c'); + const s = Stack.of('a', 'b', 'c'); expect(s.toArray()).toEqual(['a', 'b', 'c']); }); it('accepts a JS array', () => { - var s = Stack(['a', 'b', 'c']); + const s = Stack(['a', 'b', 'c']); expect(s.toArray()).toEqual(['a', 'b', 'c']); }); it('accepts a Seq', () => { - var seq = Immutable.Seq(['a', 'b', 'c']); - var s = Stack(seq); + const seq = Seq(['a', 'b', 'c']); + const s = Stack(seq); expect(s.toArray()).toEqual(['a', 'b', 'c']); }); it('accepts a keyed Seq', () => { - var seq = Immutable.Seq({a:null, b:null, c:null}).flip(); - var s = Stack(seq); - expect(s.toArray()).toEqual([[null,'a'], [null,'b'], [null,'c']]); + const seq = Seq({ a: null, b: null, c: null }).flip(); + const s = Stack(seq); + expect(s.toArray()).toEqual([ + [null, 'a'], + [null, 'b'], + [null, 'c'], + ]); // Explicit values - var s2 = Stack(seq.valueSeq()); + const s2 = Stack(seq.valueSeq()); expect(s2.toArray()).toEqual(['a', 'b', 'c']); // toStack() does this for you. - var s3 = seq.toStack(); + const s3 = seq.toStack(); expect(s3.toArray()).toEqual(['a', 'b', 'c']); }); it('pushing creates a new instance', () => { - var s0 = Stack.of('a'); - var s1 = s0.push('A'); + const s0 = Stack.of('a'); + const s1 = s0.push('A'); expect(s0.get(0)).toBe('a'); expect(s1.get(0)).toBe('A'); }); it('get helpers make for easier to read code', () => { - var s = Stack.of('a', 'b', 'c'); + const s = Stack.of('a', 'b', 'c'); expect(s.first()).toBe('a'); expect(s.last()).toBe('c'); expect(s.peek()).toBe('a'); }); it('slice helpers make for easier to read code', () => { - var s = Stack.of('a', 'b', 'c'); + const s = Stack.of('a', 'b', 'c'); expect(s.rest().toArray()).toEqual(['b', 'c']); }); - it('iterable', () => { - var s = Stack.of('a', 'b', 'c'); + it('iterable in reverse order', () => { + const s = Stack.of('a', 'b', 'c'); expect(s.size).toBe(3); - var forEachResults = []; - s.forEach((val, i) => forEachResults.push([i, val])); + const forEachResults: Array<[number, string, string | undefined]> = []; + s.forEach((val, i) => forEachResults.push([i, val, s.get(i)])); expect(forEachResults).toEqual([ - [0,'a'], - [1,'b'], - [2,'c'], + [0, 'a', 'a'], + [1, 'b', 'b'], + [2, 'c', 'c'], ]); - + // map will cause reverse iterate - expect(s.map(val => val + val).toArray()).toEqual([ - 'aa', - 'bb', - 'cc', - ]); - - var iteratorResults = []; - var iterator = s.entries(); - var step; + expect(s.map((val) => val + val).toArray()).toEqual(['aa', 'bb', 'cc']); + + let iteratorResults: Array<[number, string]> = []; + let iterator = s.entries(); + let step: IteratorResult<[number, string]>; while (!(step = iterator.next()).done) { iteratorResults.push(step.value); } expect(iteratorResults).toEqual([ - [0,'a'], - [1,'b'], - [2,'c'], + [0, 'a'], + [1, 'b'], + [2, 'c'], ]); - + iteratorResults = []; iterator = s.toSeq().reverse().entries(); while (!(step = iterator.next()).done) { iteratorResults.push(step.value); } expect(iteratorResults).toEqual([ - [0,'c'], - [1,'b'], - [2,'a'], + [0, 'c'], + [1, 'b'], + [2, 'a'], ]); }); + it('map is called in reverse order but with correct indices', () => { + const s = Stack(['a', 'b', 'c']); + const s2 = s.map((v, i, c) => v + i + c.get(i)); + expect(s2.toArray()).toEqual(['a0a', 'b1b', 'c2c']); + + const mappedSeq = s.toSeq().map((v, i, c) => v + i + c.get(i)); + const s3 = Stack(mappedSeq); + expect(s3.toArray()).toEqual(['a0a', 'b1b', 'c2c']); + }); + it('push inserts at lowest index', () => { - var s0 = Stack.of('a', 'b', 'c'); - var s1 = s0.push('d', 'e', 'f'); + const s0 = Stack.of('a', 'b', 'c'); + const s1 = s0.push('d', 'e', 'f'); expect(s0.size).toBe(3); expect(s1.size).toBe(6); expect(s1.toArray()).toEqual(['d', 'e', 'f', 'a', 'b', 'c']); }); it('pop removes the lowest index, decrementing size', () => { - var s = Stack.of('a', 'b', 'c').pop(); + const s = Stack.of('a', 'b', 'c').pop(); expect(s.peek()).toBe('b'); - expect(s.toArray()).toEqual([ 'b', 'c' ]); + expect(s.toArray()).toEqual(['b', 'c']); }); - check.it('shift removes the lowest index, just like array', {maxSize: 2000}, - [gen.posInt], len => { - var a = arrayOfSize(len); - var s = Stack(a); - - while (a.length) { + it('shift removes the lowest index, just like array', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const a = arrayOfSize(len); + let s = Stack(a); + + while (a.length) { + expect(s.size).toBe(a.length); + expect(s.toArray()).toEqual(a); + s = s.shift(); + a.shift(); + } expect(s.size).toBe(a.length); expect(s.toArray()).toEqual(a); - s = s.shift(); - a.shift(); - } - expect(s.size).toBe(a.length); - expect(s.toArray()).toEqual(a); - } - ); - - check.it('unshift adds the next lowest index, just like array', {maxSize: 2000}, - [gen.posInt], len => { - var a = []; - var s = Stack(); + }) + ); + }); - for (var ii = 0; ii < len; ii++) { + it('unshift adds the next lowest index, just like array', () => { + fc.assert( + fc.property(fc.nat(100), (len) => { + const a: Array = []; + let s = Stack(); + + for (let ii = 0; ii < len; ii++) { + expect(s.size).toBe(a.length); + expect(s.toArray()).toEqual(a); + s = s.unshift(ii); + a.unshift(ii); + } expect(s.size).toBe(a.length); expect(s.toArray()).toEqual(a); - s = s.unshift(ii); - a.unshift(ii); - } - expect(s.size).toBe(a.length); - expect(s.toArray()).toEqual(a); - } - ); + }) + ); + }); - check.it('unshifts multiple values to the front', {maxSize: 2000}, - [gen.posInt, gen.posInt], (size1: Number, size2: Number) => { - var a1 = arrayOfSize(size1); - var a2 = arrayOfSize(size2); + it('unshifts multiple values to the front', () => { + fc.assert( + fc.property(fc.nat(100), fc.nat(100), (size1: number, size2: number) => { + const a1 = arrayOfSize(size1); + const a2 = arrayOfSize(size2); - var s1 = Stack(a1); - var s3 = s1.unshift.apply(s1, a2); + const s1 = Stack(a1); + const s3 = s1.unshift.apply(s1, a2); - var a3 = a1.slice(); - a3.unshift.apply(a3, a2); + const a3 = a1.slice(); + a3.unshift.apply(a3, a2); - expect(s3.size).toEqual(a3.length); - expect(s3.toArray()).toEqual(a3); - } - ); + expect(s3.size).toEqual(a3.length); + expect(s3.toArray()).toEqual(a3); + }) + ); + }); it('finds values using indexOf', () => { - var s = Stack.of('a', 'b', 'c', 'b', 'a'); + const s = Stack.of('a', 'b', 'c', 'b', 'a'); expect(s.indexOf('b')).toBe(1); expect(s.indexOf('c')).toBe(2); expect(s.indexOf('d')).toBe(-1); }); + it('pushes on all items in an iter', () => { + const abc = Stack(['a', 'b', 'c']); + const xyz = Stack(['x', 'y', 'z']); + const xyzSeq = Seq(['x', 'y', 'z']); + + // Push all to the front of the Stack so first item ends up first. + expect(abc.pushAll(xyz).toArray()).toEqual(['x', 'y', 'z', 'a', 'b', 'c']); + expect(abc.pushAll(xyzSeq).toArray()).toEqual([ + 'x', + 'y', + 'z', + 'a', + 'b', + 'c', + ]); + + // Pushes Seq contents into Stack + expect(Stack().pushAll(xyzSeq)).not.toBe(xyzSeq); + expect(Stack().pushAll(xyzSeq).toArray()).toEqual(['x', 'y', 'z']); + + // Pushing a Stack onto an empty Stack returns === Stack + expect(Stack().pushAll(xyz)).toBe(xyz); + + // Pushing an empty Stack onto a Stack return === Stack + expect(abc.pushAll(Stack())).toBe(abc); + }); }); diff --git a/__tests__/__snapshots__/Record.ts.snap b/__tests__/__snapshots__/Record.ts.snap new file mode 100644 index 0000000000..46daf60171 --- /dev/null +++ b/__tests__/__snapshots__/Record.ts.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Record does not accept a Record as constructor 1`] = `"Can not call \`Record\` with an immutable Record as default values. Use a plain javascript object instead."`; + +exports[`Record does not accept a non object as constructor 1`] = `"Can not call \`Record\` with a non-object as default values. Use a plain javascript object instead."`; + +exports[`Record does not accept an immutable object that is not a Record as constructor 1`] = `"Can not call \`Record\` with an immutable Collection as default values. Use a plain javascript object instead."`; diff --git a/__tests__/concat.ts b/__tests__/concat.ts index b134f05666..35710a7c49 100644 --- a/__tests__/concat.ts +++ b/__tests__/concat.ts @@ -1,151 +1,222 @@ -/// -/// - -jest.autoMockOff(); - -import I = require('immutable'); -import Seq = I.Seq; - -declare function expect(val: any): ExpectWithIs; - -interface ExpectWithIs extends Expect { - is(expected: any): void; - not: ExpectWithIs; -} +import { describe, expect, it } from '@jest/globals'; +import { List, Seq, Set } from 'immutable'; describe('concat', () => { - - beforeEach(function () { - this.addMatchers({ - is: function(expected) { - return I.is(this.actual, expected); - } - }) - }) - it('concats two sequences', () => { - var a = Seq.of(1,2,3); - var b = Seq.of(4,5,6); - expect(a.concat(b)).is(Seq.of(1,2,3,4,5,6)) + const a = Seq([1, 2, 3]); + const b = Seq([4, 5, 6]); expect(a.concat(b).size).toBe(6); - expect(a.concat(b).toArray()).toEqual([1,2,3,4,5,6]); - }) + expect(a.concat(b).toArray()).toEqual([1, 2, 3, 4, 5, 6]); + }); it('concats two object sequences', () => { - var a = Seq({a:1,b:2,c:3}); - var b = Seq({d:4,e:5,f:6}); + const a = Seq({ a: 1, b: 2, c: 3 }); + const b = Seq({ d: 4, e: 5, f: 6 }); expect(a.size).toBe(3); expect(a.concat(b).size).toBe(6); - expect(a.concat(b).toObject()).toEqual({a:1,b:2,c:3,d:4,e:5,f:6}); - }) + expect(a.concat(b).toObject()).toEqual({ + a: 1, + b: 2, + c: 3, + d: 4, + e: 5, + f: 6, + }); + }); it('concats objects to keyed seq', () => { - var a = Seq({a:1,b:2,c:3}); - var b = {d:4,e:5,f:6}; - expect(a.concat(b).toObject()).toEqual({a:1,b:2,c:3,d:4,e:5,f:6}); - }) + const a = Seq({ a: 1, b: 2, c: 3 }); + const b = { d: 4, e: 5, f: 6 }; + expect(a.concat(b).toObject()).toEqual({ + a: 1, + b: 2, + c: 3, + d: 4, + e: 5, + f: 6, + }); + }); it('doesnt concat raw arrays to keyed seq', () => { - var a = Seq({a:1,b:2,c:3}); - var b = [4,5,6]; + const a = Seq({ a: 1, b: 2, c: 3 }); + const b = [4, 5, 6]; expect(() => { + // @ts-expect-error -- test that runtime does throw a.concat(b).toJS(); }).toThrow('Expected [K, V] tuple: 4'); - }) + }); it('concats arrays to indexed seq', () => { - var a = Seq.of(1,2,3); - var b = [4,5,6]; + const a = Seq([1, 2, 3]); + const b = [4, 5, 6]; expect(a.concat(b).size).toBe(6); - expect(a.concat(b).toObject()).toEqual([1,2,3,4,5,6]); - }) + expect(a.concat(b).toArray()).toEqual([1, 2, 3, 4, 5, 6]); + }); it('concats values', () => { - var a = Seq.of(1,2,3); - expect(a.concat(4,5,6).size).toBe(6); - expect(a.concat(4,5,6).toObject()).toEqual([1,2,3,4,5,6]); - }) + const a = Seq([1, 2, 3]); + expect(a.concat(4, 5, 6).size).toBe(6); + expect(a.concat(4, 5, 6).toArray()).toEqual([1, 2, 3, 4, 5, 6]); + }); it('doesnt concat objects to indexed seq', () => { - var a = Seq.of(0,1,2,3); - var b = {4:4}; - var i = a.concat(b); + const a = Seq([0, 1, 2, 3]); + const b = { 4: 4 }; + const i = a.concat(b); expect(i.size).toBe(5); expect(i.get(4)).toBe(b); - expect(i.toArray()).toEqual([0,1,2,3,{4:4}]); - }) + expect(i.toArray()).toEqual([0, 1, 2, 3, { 4: 4 }]); + }); it('concats multiple arguments', () => { - var a = Seq.of(1,2,3); - var b = [4,5,6]; - var c = [7,8,9]; + const a = Seq([1, 2, 3]); + const b = [4, 5, 6]; + const c = [7, 8, 9]; expect(a.concat(b, c).size).toBe(9); - expect(a.concat(b, c).toObject()).toEqual([1,2,3,4,5,6,7,8,9]); - }) + expect(a.concat(b, c).toArray()).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9]); + }); it('can concat itself!', () => { - var a = Seq.of(1,2,3); + const a = Seq([1, 2, 3]); expect(a.concat(a, a).size).toBe(9); - expect(a.concat(a, a).toObject()).toEqual([1,2,3,1,2,3,1,2,3]); - }) + expect(a.concat(a, a).toArray()).toEqual([1, 2, 3, 1, 2, 3, 1, 2, 3]); + }); it('returns itself when concat does nothing', () => { - var a = Seq.of(1,2,3); - var b = Seq(); + const a = Seq([1, 2, 3]); + const b = Seq(); expect(a.concat()).toBe(a); expect(a.concat(b)).toBe(a); expect(b.concat(b)).toBe(b); - }) + }); it('returns non-empty item when concat does nothing', () => { - var a = Seq.of(1,2,3); - var b = Seq(); + const a = Seq([1, 2, 3]); + const b = Seq(); expect(a.concat(b)).toBe(a); expect(b.concat(a)).toBe(a); expect(b.concat(b, b, b, a, b, b)).toBe(a); - }) + }); it('always returns the same type', () => { - var a = I.Set.of(1,2,3); - var b = I.List(); + const a = Set([1, 2, 3]); + const b = List(); expect(b.concat(a)).not.toBe(a); - expect(I.List.isList(b.concat(a))).toBe(true); - expect(b.concat(a)).is(I.List.of(1,2,3)); - }) + expect(List.isList(b.concat(a))).toBe(true); + expect(b.concat(a)).toEqual(List([1, 2, 3])); + }); it('iterates repeated keys', () => { - var a = Seq({a:1,b:2,c:3}); - expect(a.concat(a, a).toObject()).toEqual({a:1,b:2,c:3}); - expect(a.concat(a, a).toArray()).toEqual([1,2,3,1,2,3,1,2,3]); - expect(a.concat(a, a).keySeq().toArray()).toEqual(['a','b','c','a','b','c','a','b','c']); - }) + const a = Seq({ a: 1, b: 2, c: 3 }); + expect(a.concat(a, a).toObject()).toEqual({ a: 1, b: 2, c: 3 }); + expect(a.concat(a, a).valueSeq().toArray()).toEqual([ + 1, 2, 3, 1, 2, 3, 1, 2, 3, + ]); + expect(a.concat(a, a).keySeq().toArray()).toEqual([ + 'a', + 'b', + 'c', + 'a', + 'b', + 'c', + 'a', + 'b', + 'c', + ]); + expect(a.concat(a, a).toArray()).toEqual([ + ['a', 1], + ['b', 2], + ['c', 3], + ['a', 1], + ['b', 2], + ['c', 3], + ['a', 1], + ['b', 2], + ['c', 3], + ]); + }); it('lazily reverses un-indexed sequences', () => { - var a = Seq({a:1,b:2,c:3}); - var b = Seq({d:4,e:5,f:6}); - expect(a.concat(b).reverse().keySeq().toArray()).toEqual(['f','e','d','c','b','a']); - }) + const a = Seq({ a: 1, b: 2, c: 3 }); + const b = Seq({ d: 4, e: 5, f: 6 }); + expect(a.concat(b).reverse().keySeq().toArray()).toEqual([ + 'f', + 'e', + 'd', + 'c', + 'b', + 'a', + ]); + }); it('lazily reverses indexed sequences', () => { - var a = Seq([1,2,3]); + const a = Seq([1, 2, 3]); expect(a.concat(a, a).reverse().size).toBe(9); - expect(a.concat(a, a).reverse().toArray()).toEqual([3,2,1,3,2,1,3,2,1]); - }) + expect(a.concat(a, a).reverse().toArray()).toEqual([ + 3, 2, 1, 3, 2, 1, 3, 2, 1, + ]); + }); it('lazily reverses indexed sequences with unknown size, maintaining indicies', () => { - var a = Seq([1,2,3]).filter(x=>true); + const a = Seq([1, 2, 3]).filter(() => true); + expect(a.size).toBe(undefined); // Note: lazy filter does not know what size in O(1). expect(a.concat(a, a).toKeyedSeq().reverse().size).toBe(undefined); - expect(a.concat(a, a).toKeyedSeq().reverse().entrySeq().toArray()).toEqual( - [[8,3],[7,2],[6,1],[5,3],[4,2],[3,1],[2,3],[1,2],[0,1]] - ); - }) + expect(a.concat(a, a).toKeyedSeq().reverse().toArray()).toEqual([ + [8, 3], + [7, 2], + [6, 1], + [5, 3], + [4, 2], + [3, 1], + [2, 3], + [1, 2], + [0, 1], + ]); + }); it('counts from the end of the indexed sequence on negative index', () => { - var i = I.List.of(9, 5, 3, 1).map(x => - x); + const i = List.of(9, 5, 3, 1).map((x) => -x); expect(i.get(0)).toBe(-9); expect(i.get(-1)).toBe(-1); expect(i.get(-4)).toBe(-9); expect(i.get(-5, 888)).toBe(888); - }) - -}) + }); + + it('should iterate on many concatenated sequences', () => { + let meta = Seq(); + + for (let i = 0; i < 10000; ++i) { + meta = meta.concat(i) as Seq; // TODO fix typing + } + + expect(meta.toList().size).toBe(10000); + }); + + it('should handle iterator on many concatenated sequences', () => { + const nbLoops = 10000; + let meta = Seq(); + for (let i = 1; i < nbLoops; i++) { + meta = meta.concat(i) as Seq; // TODO fix typing + } + const it = meta[Symbol.iterator](); + let done = false; + let i = 0; + while (!done) { + const result = it.next(); + i++; + done = !!result.done; + } + expect(i).toBe(nbLoops); + }); + + it('should iterate on reverse order on concatenated sequences', () => { + let meta = Seq([1]); + meta = meta.concat(42); + const it = meta.reverse()[Symbol.iterator](); + const result = it.next(); + expect(result).toEqual({ + done: false, + value: 42, + }); + }); +}); diff --git a/__tests__/count.ts b/__tests__/count.ts index 8680544647..488e8d8b5d 100644 --- a/__tests__/count.ts +++ b/__tests__/count.ts @@ -1,90 +1,80 @@ -/// -/// - -jest.autoMockOff(); - -import I = require('immutable'); +import { describe, expect, it } from '@jest/globals'; +import { Range, Seq } from 'immutable'; describe('count', () => { - it('counts sequences with known lengths', () => { - expect(I.Seq.of(1,2,3,4,5).size).toBe(5); - expect(I.Seq.of(1,2,3,4,5).count()).toBe(5); - }) + expect(Seq([1, 2, 3, 4, 5]).size).toBe(5); + expect(Seq([1, 2, 3, 4, 5]).count()).toBe(5); + }); it('counts sequences with unknown lengths, resulting in a cached size', () => { - var seq = I.Seq.of(1,2,3,4,5,6).filter(x => x % 2 === 0); + const seq = Seq([1, 2, 3, 4, 5, 6]).filter((x) => x % 2 === 0); expect(seq.size).toBe(undefined); expect(seq.count()).toBe(3); expect(seq.size).toBe(3); - }) + }); it('counts sequences with a specific predicate', () => { - var seq = I.Seq.of(1,2,3,4,5,6); + const seq = Seq([1, 2, 3, 4, 5, 6]); expect(seq.size).toBe(6); - expect(seq.count(x => x > 3)).toBe(3); - }) + expect(seq.count((x) => x > 3)).toBe(3); + }); describe('countBy', () => { - it('counts by keyed sequence', () => { - var grouped = I.Seq({a:1,b:2,c:3,d:4}).countBy(x => x % 2); - expect(grouped.toJS()).toEqual({1:2, 0:2}); + const grouped = Seq({ a: 1, b: 2, c: 3, d: 4 }).countBy((x) => x % 2); + expect(grouped.toJS()).toEqual({ 1: 2, 0: 2 }); expect(grouped.get(1)).toEqual(2); - }) + }); it('counts by indexed sequence', () => { expect( - I.Seq.of(1,2,3,4,5,6).countBy(x => x % 2).toJS() - ).toEqual( - {1:3, 0:3} - ); - }) + Seq([1, 2, 3, 4, 5, 6]) + .countBy((x) => x % 2) + .toJS() + ).toEqual({ 1: 3, 0: 3 }); + }); it('counts by specific keys', () => { expect( - I.Seq.of(1,2,3,4,5,6).countBy(x => x % 2 ? 'odd' : 'even').toJS() - ).toEqual( - {odd:3, even:3} - ); - }) - - }) + Seq([1, 2, 3, 4, 5, 6]) + .countBy((x) => (x % 2 ? 'odd' : 'even')) + .toJS() + ).toEqual({ odd: 3, even: 3 }); + }); + }); describe('isEmpty', () => { - it('is O(1) on sequences with known lengths', () => { - expect(I.Seq.of(1,2,3,4,5).size).toBe(5); - expect(I.Seq.of(1,2,3,4,5).isEmpty()).toBe(false); - expect(I.Seq().size).toBe(0); - expect(I.Seq().isEmpty()).toBe(true); - }) + expect(Seq([1, 2, 3, 4, 5]).size).toBe(5); + expect(Seq([1, 2, 3, 4, 5]).isEmpty()).toBe(false); + expect(Seq().size).toBe(0); + expect(Seq().isEmpty()).toBe(true); + }); it('lazily evaluates Seq with unknown length', () => { - var seq = I.Seq.of(1,2,3,4,5,6).filter(x => x % 2 === 0); + let seq = Seq([1, 2, 3, 4, 5, 6]).filter((x) => x % 2 === 0); expect(seq.size).toBe(undefined); expect(seq.isEmpty()).toBe(false); expect(seq.size).toBe(undefined); - var seq = I.Seq.of(1,2,3,4,5,6).filter(x => x > 10); + seq = Seq([1, 2, 3, 4, 5, 6]).filter((x) => x > 10); expect(seq.size).toBe(undefined); expect(seq.isEmpty()).toBe(true); expect(seq.size).toBe(undefined); - }) + }); it('with infinitely long sequences of known length', () => { - var seq = I.Range(); + const seq = Range(0, Infinity); expect(seq.size).toBe(Infinity); expect(seq.isEmpty()).toBe(false); - }) + }); it('with infinitely long sequences of unknown length', () => { - var seq = I.Range().filter(x => x % 2 === 0); + const seq = Range(0, Infinity).filter((x) => x % 2 === 0); expect(seq.size).toBe(undefined); expect(seq.isEmpty()).toBe(false); expect(seq.size).toBe(undefined); - }) - - }) - -}) + }); + }); +}); diff --git a/__tests__/find.ts b/__tests__/find.ts new file mode 100644 index 0000000000..2f6f186690 --- /dev/null +++ b/__tests__/find.ts @@ -0,0 +1,25 @@ +import { describe, expect, it } from '@jest/globals'; +import { Seq } from 'immutable'; + +describe('find', () => { + it('find returns notSetValue when match is not found', () => { + expect(Seq([1, 2, 3, 4, 5, 6]).find(() => false, null, 9)).toEqual(9); + }); + + it('findEntry returns notSetValue when match is not found', () => { + expect( + Seq([1, 2, 3, 4, 5, 6]).findEntry( + () => false, + + null, + 9 + ) + ).toEqual(9); + }); + + it('findLastEntry returns notSetValue when match is not found', () => { + expect(Seq([1, 2, 3, 4, 5, 6]).findLastEntry(() => false, null, 9)).toEqual( + 9 + ); + }); +}); diff --git a/__tests__/flatten.ts b/__tests__/flatten.ts index 1583939d35..0d5cea91e8 100644 --- a/__tests__/flatten.ts +++ b/__tests__/flatten.ts @@ -1,142 +1,143 @@ -/// -/// - -jest.autoMockOff(); - -import I = require('immutable'); - -import jasmineCheck = require('jasmine-check'); -jasmineCheck.install(); - -type SeqType = number | number[] | I.Iterable; +import { describe, expect, it } from '@jest/globals'; +import { Collection, fromJS, List, Range, Seq } from 'immutable'; describe('flatten', () => { - it('flattens sequences one level deep', () => { - var nested = I.fromJS([[1,2],[3,4],[5,6]]); - var flat = nested.flatten(); - expect(flat.toJS()).toEqual([1,2,3,4,5,6]); - }) + const nested = fromJS([ + [1, 2], + [3, 4], + [5, 6], + ]); + const flat = nested.flatten(); + expect(flat.toJS()).toEqual([1, 2, 3, 4, 5, 6]); + }); it('flattening a List returns a List', () => { - var nested = I.fromJS([[1],2,3,[4,5,6]]); - var flat = nested.flatten(); - expect(flat.toString()).toEqual("List [ 1, 2, 3, 4, 5, 6 ]"); - }) + const nested = fromJS([[1], 2, 3, [4, 5, 6]]); + const flat = nested.flatten(); + expect(flat.toString()).toEqual('List [ 1, 2, 3, 4, 5, 6 ]'); + }); it('gives the correct iteration count', () => { - var nested = I.fromJS([[1,2,3],[4,5,6]]); - var flat = nested.flatten(); - expect(flat.forEach(x => x < 4)).toEqual(4); - }) + const nested = fromJS([ + [1, 2, 3], + [4, 5, 6], + ]); + const flat = nested.flatten(); + // @ts-expect-error -- `flatten` return type should be improved + expect(flat.forEach((x: number) => x < 4)).toEqual(4); + }); + + type SeqType = number | Array | Collection; it('flattens only Sequences (not sequenceables)', () => { - var nested = I.Seq.of(I.Range(1,3),[3,4],I.List.of(5,6,7),8); - var flat = nested.flatten(); - expect(flat.toJS()).toEqual([1,2,[3,4],5,6,7,8]); - }) + const nested = Seq([Range(1, 3), [3, 4], List([5, 6, 7]), 8]); + const flat = nested.flatten(); + expect(flat.toJS()).toEqual([1, 2, [3, 4], 5, 6, 7, 8]); + }); it('can be reversed', () => { - var nested = I.Seq.of(I.Range(1,3),[3,4],I.List.of(5,6,7),8); - var flat = nested.flatten(); - var reversed = flat.reverse(); - expect(reversed.toJS()).toEqual([8,7,6,5,[3,4],2,1]); - }) + const nested = Seq([Range(1, 3), [3, 4], List([5, 6, 7]), 8]); + const flat = nested.flatten(); + const reversed = flat.reverse(); + expect(reversed.toJS()).toEqual([8, 7, 6, 5, [3, 4], 2, 1]); + }); it('can flatten at various levels of depth', () => { - var deeplyNested = I.fromJS( + const deeplyNested = fromJS([ [ [ - [ - [ 'A', 'B' ], - [ 'A', 'B' ], - ], - [ - [ 'A', 'B' ], - [ 'A', 'B' ], - ], + ['A', 'B'], + ['A', 'B'], ], [ - [ - [ 'A', 'B' ], - [ 'A', 'B' ], - ], - [ - [ 'A', 'B' ], - [ 'A', 'B' ], - ] - ] - ] - ); - - // deeply flatten - expect(deeplyNested.flatten().toJS()).toEqual( - ['A','B','A','B','A','B','A','B','A','B','A','B','A','B','A','B'] - ); - - // shallow flatten - expect(deeplyNested.flatten(true).toJS()).toEqual( - [ - [ - [ 'A', 'B' ], - [ 'A', 'B' ], + ['A', 'B'], + ['A', 'B'], ], + ], + [ [ - [ 'A', 'B' ], - [ 'A', 'B' ], + ['A', 'B'], + ['A', 'B'], ], [ - [ 'A', 'B' ], - [ 'A', 'B' ], + ['A', 'B'], + ['A', 'B'], ], - [ - [ 'A', 'B' ], - [ 'A', 'B' ], - ] - ] - ); + ], + ]); - // flatten two levels - expect(deeplyNested.flatten(2).toJS()).toEqual( + // deeply flatten + expect(deeplyNested.flatten().toJS()).toEqual([ + 'A', + 'B', + 'A', + 'B', + 'A', + 'B', + 'A', + 'B', + 'A', + 'B', + 'A', + 'B', + 'A', + 'B', + 'A', + 'B', + ]); + + // shallow flatten + expect(deeplyNested.flatten(true).toJS()).toEqual([ + [ + ['A', 'B'], + ['A', 'B'], + ], + [ + ['A', 'B'], + ['A', 'B'], + ], + [ + ['A', 'B'], + ['A', 'B'], + ], [ - [ 'A', 'B' ], - [ 'A', 'B' ], - [ 'A', 'B' ], - [ 'A', 'B' ], - [ 'A', 'B' ], - [ 'A', 'B' ], - [ 'A', 'B' ], - [ 'A', 'B' ] - ] - ); + ['A', 'B'], + ['A', 'B'], + ], + ]); + + // flatten two levels + expect(deeplyNested.flatten(2).toJS()).toEqual([ + ['A', 'B'], + ['A', 'B'], + ['A', 'B'], + ['A', 'B'], + ['A', 'B'], + ['A', 'B'], + ['A', 'B'], + ['A', 'B'], + ]); }); describe('flatMap', () => { - it('first maps, then shallow flattens', () => { - var numbers = I.Range(97, 100); - var letters = numbers.flatMap(v => I.fromJS([ - String.fromCharCode(v), - String.fromCharCode(v).toUpperCase(), - ])); - expect(letters.toJS()).toEqual( - ['a','A','b','B','c','C'] - ) + const numbers = Range(97, 100); + const letters = numbers.flatMap((v) => + fromJS([String.fromCharCode(v), String.fromCharCode(v).toUpperCase()]) + ); + expect(letters.toJS()).toEqual(['a', 'A', 'b', 'B', 'c', 'C']); }); it('maps to sequenceables, not only Sequences.', () => { - var numbers = I.Range(97, 100); - // the map function returns an Array, rather than an Iterable. - // Array is sequenceable, so this works just fine. - var letters = numbers.flatMap(v => [ + const numbers = Range(97, 100); + // the map function returns an Array, rather than a Collection. + // Array is iterable, so this works just fine. + const letters = numbers.flatMap((v) => [ String.fromCharCode(v), - String.fromCharCode(v).toUpperCase() + String.fromCharCode(v).toUpperCase(), ]); - expect(letters.toJS()).toEqual( - ['a','A','b','B','c','C'] - ) + expect(letters.toJS()).toEqual(['a', 'A', 'b', 'B', 'c', 'C']); }); - }); - }); diff --git a/__tests__/fromJS.ts b/__tests__/fromJS.ts new file mode 100644 index 0000000000..90f70228e2 --- /dev/null +++ b/__tests__/fromJS.ts @@ -0,0 +1,81 @@ +import { describe, expect, it } from '@jest/globals'; +import { runInNewContext } from 'vm'; +import { List, Map, Set, isCollection, fromJS } from 'immutable'; + +describe('fromJS', () => { + it('convert Array to Immutable.List', () => { + const list = fromJS([1, 2, 3]); + expect(List.isList(list)).toBe(true); + expect(list.count()).toBe(3); + }); + + it('convert plain Object to Immutable.Map', () => { + const map = fromJS({ a: 'A', b: 'B', c: 'C' }); + expect(Map.isMap(map)).toBe(true); + expect(map.count()).toBe(3); + }); + + it('convert JS (global) Set to Immutable.Set', () => { + const set = fromJS(new global.Set([1, 2, 3])); + expect(Set.isSet(set)).toBe(true); + expect(set.count()).toBe(3); + }); + + it('convert JS (global) Map to Immutable.Map', () => { + const map = fromJS( + new global.Map([ + ['a', 'A'], + ['b', 'B'], + ['c', 'C'], + ]) + ); + expect(Map.isMap(map)).toBe(true); + expect(map.count()).toBe(3); + }); + + it('convert iterable to Immutable collection', () => { + function* values() { + yield 1; + yield 2; + yield 3; + } + const result = fromJS(values()); + expect(List.isList(result)).toBe(true); + expect(result.count()).toBe(3); + }); + + it('does not convert existing Immutable collections', () => { + const orderedSet = Set(['a', 'b', 'c']); + expect(fromJS(orderedSet)).toBe(orderedSet); + }); + + it('does not convert strings', () => { + expect(fromJS('abc')).toBe('abc'); + }); + + it('does not convert non-plain Objects', () => { + class Test {} + const result = fromJS(new Test()); + expect(isCollection(result)).toBe(false); + expect(result instanceof Test).toBe(true); + }); + + it('is iterable outside of a vm', () => { + expect(isCollection(fromJS({}))).toBe(true); + }); + + // eslint-disable-next-line jest/expect-expect + it('is iterable inside of a vm', () => { + runInNewContext( + ` + expect(isCollection(fromJS({}))).toBe(true); + `, + { + expect, + isCollection, + fromJS, + }, + {} + ); + }); +}); diff --git a/__tests__/functional/get.ts b/__tests__/functional/get.ts new file mode 100644 index 0000000000..901724f1c3 --- /dev/null +++ b/__tests__/functional/get.ts @@ -0,0 +1,37 @@ +import { describe, expect, it } from '@jest/globals'; +import { get, Map, List, Range } from 'immutable'; + +describe('get', () => { + it('for immutable structure', () => { + expect(get(Range(0, 100), 20)).toBe(20); + expect(get(List(['dog', 'frog', 'cat']), 1)).toBe('frog'); + expect(get(List(['dog', 'frog', 'cat']), 20)).toBeUndefined(); + expect(get(List(['dog', 'frog', 'cat']), 20, 'ifNotSet')).toBe('ifNotSet'); + + expect(get(Map({ x: 123, y: 456 }), 'x')).toBe(123); + }); + + it('for Array', () => { + expect(get(['dog', 'frog', 'cat'], 1)).toBe('frog'); + expect(get(['dog', 'frog', 'cat'], 20)).toBeUndefined(); + expect(get(['dog', 'frog', 'cat'], 20, 'ifNotSet')).toBe('ifNotSet'); + }); + + it('for plain objects', () => { + expect(get({ x: 123, y: 456 }, 'x')).toBe(123); + expect(get({ x: 123, y: 456 }, 'z', 'ifNotSet')).toBe('ifNotSet'); + + expect( + get( + { + x: 'xx', + y: 'yy', + get: function (key: string) { + return `${this[key].toUpperCase()}`; + }, + }, + 'x' + ) + ).toBe('XX'); + }); +}); diff --git a/__tests__/functional/has.ts b/__tests__/functional/has.ts new file mode 100644 index 0000000000..3d4f550dec --- /dev/null +++ b/__tests__/functional/has.ts @@ -0,0 +1,21 @@ +import { describe, expect, it } from '@jest/globals'; +import { has, Map, List, Range } from 'immutable'; + +describe('has', () => { + it('for immutable structure', () => { + expect(has(Range(0, 100), 20)).toBe(true); + expect(has(List(['dog', 'frog', 'cat']), 1)).toBe(true); + expect(has(List(['dog', 'frog', 'cat']), 20)).toBe(false); + + expect(has(Map({ x: 123, y: 456 }), 'x')).toBe(true); + }); + it('for Array', () => { + expect(has(['dog', 'frog', 'cat'], 1)).toBe(true); + expect(has(['dog', 'frog', 'cat'], 20)).toBe(false); + }); + + it('for plain objects', () => { + expect(has({ x: 123, y: 456 }, 'x')).toBe(true); + expect(has({ x: 123, y: 456 }, 'z')).toBe(false); + }); +}); diff --git a/__tests__/functional/remove.ts b/__tests__/functional/remove.ts new file mode 100644 index 0000000000..10674c695b --- /dev/null +++ b/__tests__/functional/remove.ts @@ -0,0 +1,19 @@ +import { describe, expect, it } from '@jest/globals'; +import { remove, List, Map } from 'immutable'; + +describe('remove', () => { + it('for immutable structure', () => { + expect(remove(List(['dog', 'frog', 'cat']), 1)).toEqual( + List(['dog', 'cat']) + ); + expect(remove(Map({ x: 123, y: 456 }), 'x')).toEqual(Map({ y: 456 })); + }); + + it('for Array', () => { + expect(remove(['dog', 'frog', 'cat'], 1)).toEqual(['dog', 'cat']); + }); + + it('for plain objects', () => { + expect(remove({ x: 123, y: 456 }, 'x')).toEqual({ y: 456 }); + }); +}); diff --git a/__tests__/functional/set.ts b/__tests__/functional/set.ts new file mode 100644 index 0000000000..154009880a --- /dev/null +++ b/__tests__/functional/set.ts @@ -0,0 +1,42 @@ +import { describe, expect, it } from '@jest/globals'; +import { set } from 'immutable'; + +describe('set', () => { + it('for immutable structure', () => { + const originalArray = ['dog', 'frog', 'cat']; + expect(set(originalArray, 1, 'cow')).toEqual(['dog', 'cow', 'cat']); + expect(set(originalArray, 4, 'cow')).toEqual([ + 'dog', + 'frog', + 'cat', + undefined, + 'cow', + ]); + expect(originalArray).toEqual(['dog', 'frog', 'cat']); + + const originalObject = { x: 123, y: 456 }; + expect(set(originalObject, 'x', 789)).toEqual({ x: 789, y: 456 }); + expect(set(originalObject, 'z', 789)).toEqual({ x: 123, y: 456, z: 789 }); + expect(originalObject).toEqual({ x: 123, y: 456 }); + }); + + it('for Array', () => { + const originalArray = ['dog', 'frog', 'cat']; + expect(set(originalArray, 1, 'cow')).toEqual(['dog', 'cow', 'cat']); + expect(set(originalArray, 4, 'cow')).toEqual([ + 'dog', + 'frog', + 'cat', + undefined, + 'cow', + ]); + expect(originalArray).toEqual(['dog', 'frog', 'cat']); + }); + + it('for plain objects', () => { + const originalObject = { x: 123, y: 456 }; + expect(set(originalObject, 'x', 789)).toEqual({ x: 789, y: 456 }); + expect(set(originalObject, 'z', 789)).toEqual({ x: 123, y: 456, z: 789 }); + expect(originalObject).toEqual({ x: 123, y: 456 }); + }); +}); diff --git a/__tests__/functional/update.ts b/__tests__/functional/update.ts new file mode 100644 index 0000000000..0ed9042e85 --- /dev/null +++ b/__tests__/functional/update.ts @@ -0,0 +1,40 @@ +import { describe, expect, it } from '@jest/globals'; +import { update } from 'immutable'; + +describe('update', () => { + it('for immutable structure', () => { + const originalArray = ['dog', 'frog', 'cat']; + expect(update(originalArray, 1, (val) => val?.toUpperCase())).toEqual([ + 'dog', + 'FROG', + 'cat', + ]); + expect(originalArray).toEqual(['dog', 'frog', 'cat']); + + const originalObject = { x: 123, y: 456 }; + expect(update(originalObject, 'x', (val) => val * 6)).toEqual({ + x: 738, + y: 456, + }); + expect(originalObject).toEqual({ x: 123, y: 456 }); + }); + + it('for Array', () => { + const originalArray = ['dog', 'frog', 'cat']; + expect(update(originalArray, 1, (val) => val?.toUpperCase())).toEqual([ + 'dog', + 'FROG', + 'cat', + ]); + expect(originalArray).toEqual(['dog', 'frog', 'cat']); + }); + + it('for plain objects', () => { + const originalObject = { x: 123, y: 456 }; + expect(update(originalObject, 'x', (val) => val * 6)).toEqual({ + x: 738, + y: 456, + }); + expect(originalObject).toEqual({ x: 123, y: 456 }); + }); +}); diff --git a/__tests__/get.ts b/__tests__/get.ts index 342d0675c1..7853ad30ca 100644 --- a/__tests__/get.ts +++ b/__tests__/get.ts @@ -1,55 +1,49 @@ -/// -/// - -jest.autoMockOff(); - -import I = require('immutable'); +import { describe, expect, it } from '@jest/globals'; +import { Range } from 'immutable'; describe('get', () => { - it('gets any index', () => { - var seq = I.Range(0, 100); + const seq = Range(0, 100); expect(seq.get(20)).toBe(20); }); it('gets first', () => { - var seq = I.Range(0, 100); + const seq = Range(0, 100); expect(seq.first()).toBe(0); }); it('gets last', () => { - var seq = I.Range(0, 100); + const seq = Range(0, 100); expect(seq.last()).toBe(99); }); it('gets any index after reversing', () => { - var seq = I.Range(0, 100).reverse(); + const seq = Range(0, 100).reverse(); expect(seq.get(20)).toBe(79); }); it('gets first after reversing', () => { - var seq = I.Range(0, 100).reverse(); + const seq = Range(0, 100).reverse(); expect(seq.first()).toBe(99); }); it('gets last after reversing', () => { - var seq = I.Range(0, 100).reverse(); + const seq = Range(0, 100).reverse(); expect(seq.last()).toBe(0); }); it('gets any index when size is unknown', () => { - var seq = I.Range(0, 100).filter(x => x % 2 === 1); + const seq = Range(0, 100).filter((x) => x % 2 === 1); expect(seq.get(20)).toBe(41); }); it('gets first when size is unknown', () => { - var seq = I.Range(0, 100).filter(x => x % 2 === 1); + const seq = Range(0, 100).filter((x) => x % 2 === 1); expect(seq.first()).toBe(1); }); it('gets last when size is unknown', () => { - var seq = I.Range(0, 100).filter(x => x % 2 === 1); + const seq = Range(0, 100).filter((x) => x % 2 === 1); expect(seq.last()).toBe(99); // Note: this is O(N) }); - }); diff --git a/__tests__/getIn.ts b/__tests__/getIn.ts new file mode 100644 index 0000000000..57074034c6 --- /dev/null +++ b/__tests__/getIn.ts @@ -0,0 +1,97 @@ +import { describe, expect, it } from '@jest/globals'; +import { fromJS, getIn, List, Map } from 'immutable'; + +describe('getIn', () => { + it('deep get', () => { + const m = fromJS({ a: { b: { c: 10 } } }); + expect(m.getIn(['a', 'b', 'c'])).toEqual(10); + expect(getIn(m, ['a', 'b', 'c'])).toEqual(10); + }); + + it('deep get with list as keyPath', () => { + const m = fromJS({ a: { b: { c: 10 } } }); + expect(m.getIn(fromJS(['a', 'b', 'c']))).toEqual(10); + expect(getIn(m, fromJS(['a', 'b', 'c']))).toEqual(10); + }); + + it('deep get throws without list or array-like', () => { + // @ts-expect-error -- test that runtime does throw + expect(() => Map().getIn(undefined)).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: undefined' + ); + // @ts-expect-error -- test that runtime does throw + expect(() => Map().getIn({ a: 1, b: 2 })).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: [object Object]' + ); + // TODO: should expect error + expect(() => Map().getIn('abc')).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: abc' + ); + // TODO: should expect error + expect(() => getIn(Map(), 'abc')).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: abc' + ); + }); + + it('deep get returns not found if path does not match', () => { + const m = fromJS({ a: { b: { c: 10 } } }); + expect(m.getIn(['a', 'b', 'z'])).toEqual(undefined); + expect(m.getIn(['a', 'b', 'z'], 123)).toEqual(123); + expect(m.getIn(['a', 'y', 'z'])).toEqual(undefined); + expect(m.getIn(['a', 'y', 'z'], 123)).toEqual(123); + expect(getIn(m, ['a', 'y', 'z'])).toEqual(undefined); + expect(getIn(m, ['a', 'y', 'z'], 123)).toEqual(123); + }); + + it('does not use notSetValue when path does exist but value is nullable', () => { + const m = fromJS({ a: { b: { c: null, d: undefined } } }); + expect(m.getIn(['a', 'b', 'c'])).toEqual(null); + expect(m.getIn(['a', 'b', 'd'])).toEqual(undefined); + expect(m.getIn(['a', 'b', 'c'], 123)).toEqual(null); + expect(m.getIn(['a', 'b', 'd'], 123)).toEqual(undefined); + expect(getIn(m, ['a', 'b', 'c'], 123)).toEqual(null); + expect(getIn(m, ['a', 'b', 'd'], 123)).toEqual(undefined); + }); + + it('deep get returns not found if path encounters non-data-structure', () => { + const m = fromJS({ a: { b: { c: null, d: undefined } } }); + expect(m.getIn(['a', 'b', 'c', 'x'])).toEqual(undefined); + expect(m.getIn(['a', 'b', 'c', 'x'], 123)).toEqual(123); + expect(m.getIn(['a', 'b', 'd', 'x'])).toEqual(undefined); + expect(m.getIn(['a', 'b', 'd', 'x'], 123)).toEqual(123); + expect(getIn(m, ['a', 'b', 'd', 'x'])).toEqual(undefined); + expect(getIn(m, ['a', 'b', 'd', 'x'], 123)).toEqual(123); + + expect(getIn('a', ['length'])).toEqual(undefined); + expect(getIn(new Date(), ['getDate'])).toEqual(undefined); + }); + + it('gets in nested plain Objects and Arrays', () => { + const m = List([{ key: ['item'] }]); + expect(m.getIn([0, 'key', 0])).toEqual('item'); + }); + + it('deep get returns not found if non-existing path in nested plain Object', () => { + const deep = Map({ + key: { regular: 'jsobj' }, + list: List([Map({ num: 10 })]), + }); + expect(deep.getIn(['key', 'foo', 'item'])).toBe(undefined); + expect(deep.getIn(['key', 'foo', 'item'], 'notSet')).toBe('notSet'); + expect(deep.getIn(['list', 0, 'num', 'badKey'])).toBe(undefined); + expect(deep.getIn(['list', 0, 'num', 'badKey'], 'notSet')).toBe('notSet'); + }); + + it('gets in plain Objects and Arrays', () => { + const m = [{ key: ['item'] }]; + expect(getIn(m, [0, 'key', 0])).toEqual('item'); + }); + + it('deep get returns not found if non-existing path in plain Object', () => { + const deep = { key: { regular: 'jsobj' }, list: [{ num: 10 }] }; + expect(getIn(deep, ['key', 'foo', 'item'])).toBe(undefined); + expect(getIn(deep, ['key', 'foo', 'item'], 'notSet')).toBe('notSet'); + expect(getIn(deep, ['list', 0, 'num', 'badKey'])).toBe(undefined); + expect(getIn(deep, ['list', 0, 'num', 'badKey'], 'notSet')).toBe('notSet'); + }); +}); diff --git a/__tests__/groupBy.ts b/__tests__/groupBy.ts index 139bda74a8..bfaba132df 100644 --- a/__tests__/groupBy.ts +++ b/__tests__/groupBy.ts @@ -1,62 +1,107 @@ -/// -/// +import { describe, expect, it } from '@jest/globals'; +import { + Collection, + Map, + Seq, + isOrdered, + OrderedMap, + List, + OrderedSet, + Set, + Stack, +} from 'immutable'; -jest.autoMockOff(); +describe('groupBy', () => { + it.each` + constructor | constructorIsOrdered | isObject + ${Collection} | ${true} | ${false} + ${List} | ${true} | ${false} + ${Seq} | ${true} | ${false} + ${Set} | ${false} | ${false} + ${Stack} | ${true} | ${false} + ${OrderedSet} | ${true} | ${false} + ${Map} | ${false} | ${true} + ${OrderedMap} | ${true} | ${true} + `( + 'groupBy returns ordered or unordered of the base type is ordered or not: $constructor.name', + ({ constructor, constructorIsOrdered, isObject }) => { + const iterableConstructor = ['a', 'b', 'a', 'c']; + const objectConstructor = { a: 1, b: 2, c: 3, d: 1 }; -import I = require('immutable'); + const col = constructor( + isObject ? objectConstructor : iterableConstructor + ); -describe('groupBy', () => { + const grouped = col.groupBy((v) => v); + + // all groupBy should be instance of Map + expect(grouped).toBeInstanceOf(Map); + + // ordered objects should be instance of OrderedMap + expect(isOrdered(col)).toBe(constructorIsOrdered); + expect(isOrdered(grouped)).toBe(constructorIsOrdered); + if (constructorIsOrdered) { + // eslint-disable-next-line jest/no-conditional-expect + expect(grouped).toBeInstanceOf(OrderedMap); + } else { + // eslint-disable-next-line jest/no-conditional-expect + expect(grouped).not.toBeInstanceOf(OrderedMap); + } + } + ); it('groups keyed sequence', () => { - var grouped = I.Seq({a:1,b:2,c:3,d:4}).groupBy(x => x % 2); - expect(grouped.toJS()).toEqual({1:{a:1,c:3}, 0:{b:2,d:4}}); + const grouped = Seq({ a: 1, b: 2, c: 3, d: 4 }).groupBy((x) => x % 2); + expect(grouped.toJS()).toEqual({ 1: { a: 1, c: 3 }, 0: { b: 2, d: 4 } }); // Each group should be a keyed sequence, not an indexed sequence - expect(grouped.get(1).toArray()).toEqual([1, 3]); - }) + const firstGroup = grouped.get(1); + expect(firstGroup && firstGroup.toArray()).toEqual([ + ['a', 1], + ['c', 3], + ]); + }); it('groups indexed sequence', () => { - expect( - I.Seq.of(1,2,3,4,5,6).groupBy(x => x % 2).toJS() - ).toEqual( - {1:[1,3,5], 0:[2,4,6]} - ); - }) + const group = Seq([1, 2, 3, 4, 5, 6]).groupBy((x) => x % 2); + + expect(group.toJS()).toEqual({ 1: [1, 3, 5], 0: [2, 4, 6] }); + }); it('groups to keys', () => { - expect( - I.Seq.of(1,2,3,4,5,6).groupBy(x => x % 2 ? 'odd' : 'even').toJS() - ).toEqual( - {odd:[1,3,5], even:[2,4,6]} + const group = Seq([1, 2, 3, 4, 5, 6]).groupBy((x) => + x % 2 ? 'odd' : 'even' ); - }) + expect(group.toJS()).toEqual({ odd: [1, 3, 5], even: [2, 4, 6] }); + }); - it('groups indexed sequences, maintaining indicies', () => { - expect( - I.Seq.of(1,2,3,4,5,6).toKeyedSeq().groupBy(x => x % 2).toJS() - ).toEqual( - {1:[1,,3,,5,,,], 0:[,2,,4,,6]} + it('allows `undefined` as a key', () => { + const group = Seq([1, 2, 3, 4, 5, 6]).groupBy((x) => + x % 2 ? undefined : 'even' ); - }) + expect(group.toJS()).toEqual({ undefined: [1, 3, 5], even: [2, 4, 6] }); + }); - it('has groups that can be mapped', () => { - expect( - I.Seq.of(1,2,3,4,5,6).groupBy(x => x % 2).map(group => group.map(value => value * 10)).toJS() - ).toEqual( - {1:[10,30,50], 0:[20,40,60]} - ); - }) + it('groups indexed sequences, maintaining indicies when keyed sequences', () => { + const group = Seq([1, 2, 3, 4, 5, 6]).groupBy((x) => x % 2); + + expect(group.toJS()).toEqual({ 1: [1, 3, 5], 0: [2, 4, 6] }); - it('returns an ordered map from an ordered collection', () => { - var seq = I.Seq.of('Z','Y','X','Z','Y','X'); - expect(I.Iterable.isOrdered(seq)).toBe(true); - var seqGroups = seq.groupBy(x => x); - expect(I.Iterable.isOrdered(seqGroups)).toBe(true); + const keyedGroup = Seq([1, 2, 3, 4, 5, 6]) + .toKeyedSeq() + .groupBy((x) => x % 2); - var map = I.Map({ x: 1, y: 2 }); - expect(I.Iterable.isOrdered(map)).toBe(false); - var mapGroups = map.groupBy(x => x); - expect(I.Iterable.isOrdered(mapGroups)).toBe(false); - }) + expect(keyedGroup.toJS()).toEqual({ + 1: { 0: 1, 2: 3, 4: 5 }, + 0: { 1: 2, 3: 4, 5: 6 }, + }); + }); + + it('has groups that can be mapped', () => { + const mappedGroup = Seq([1, 2, 3, 4, 5, 6]) + .groupBy((x) => x % 2) + .map((group) => group.map((value) => value * 10)); -}) + expect(mappedGroup.toJS()).toEqual({ 1: [10, 30, 50], 0: [20, 40, 60] }); + }); +}); diff --git a/__tests__/hasIn.ts b/__tests__/hasIn.ts new file mode 100644 index 0000000000..da2baa0a89 --- /dev/null +++ b/__tests__/hasIn.ts @@ -0,0 +1,63 @@ +import { describe, expect, it } from '@jest/globals'; +import { fromJS, hasIn, List, Map } from 'immutable'; + +describe('hasIn', () => { + it('deep has', () => { + const m = fromJS({ a: { b: { c: 10, d: undefined } } }); + expect(m.hasIn(['a', 'b', 'c'])).toEqual(true); + expect(m.hasIn(['a', 'b', 'd'])).toEqual(true); + expect(m.hasIn(['a', 'b', 'z'])).toEqual(false); + expect(m.hasIn(['a', 'y', 'z'])).toEqual(false); + expect(hasIn(m, ['a', 'b', 'c'])).toEqual(true); + expect(hasIn(m, ['a', 'b', 'z'])).toEqual(false); + }); + + it('deep has with list as keyPath', () => { + const m = fromJS({ a: { b: { c: 10 } } }); + expect(m.hasIn(fromJS(['a', 'b', 'c']))).toEqual(true); + expect(m.hasIn(fromJS(['a', 'b', 'z']))).toEqual(false); + expect(m.hasIn(fromJS(['a', 'y', 'z']))).toEqual(false); + expect(hasIn(m, fromJS(['a', 'b', 'c']))).toEqual(true); + expect(hasIn(m, fromJS(['a', 'y', 'z']))).toEqual(false); + }); + + it('deep has throws without list or array-like', () => { + // @ts-expect-error -- test that runtime does throw + expect(() => Map().hasIn(undefined)).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: undefined' + ); + // @ts-expect-error -- test that runtime does throw + expect(() => Map().hasIn({ a: 1, b: 2 })).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: [object Object]' + ); + // TODO: should expect error + expect(() => Map().hasIn('abc')).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: abc' + ); + // TODO: should expect error + expect(() => hasIn(Map(), 'abc')).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: abc' + ); + }); + + it('deep has does not throw if non-readable path', () => { + const deep = Map({ + key: { regular: 'jsobj' }, + list: List([Map({ num: 10 })]), + }); + expect(deep.hasIn(['key', 'foo', 'item'])).toBe(false); + expect(deep.hasIn(['list', 0, 'num', 'badKey'])).toBe(false); + expect(hasIn(deep, ['key', 'foo', 'item'])).toBe(false); + expect(hasIn(deep, ['list', 0, 'num', 'badKey'])).toBe(false); + }); + + it('deep has in plain Object and Array', () => { + const m = { a: { b: { c: [10, undefined], d: undefined } } }; + expect(hasIn(m, ['a', 'b', 'c', 0])).toEqual(true); + expect(hasIn(m, ['a', 'b', 'c', 1])).toEqual(true); + expect(hasIn(m, ['a', 'b', 'c', 2])).toEqual(false); + expect(hasIn(m, ['a', 'b', 'd'])).toEqual(true); + expect(hasIn(m, ['a', 'b', 'z'])).toEqual(false); + expect(hasIn(m, ['a', 'b', 'z'])).toEqual(false); + }); +}); diff --git a/__tests__/hash.ts b/__tests__/hash.ts new file mode 100644 index 0000000000..168ded87f1 --- /dev/null +++ b/__tests__/hash.ts @@ -0,0 +1,56 @@ +import { describe, expect, it } from '@jest/globals'; +import { hash } from 'immutable'; +import fc from 'fast-check'; + +describe('hash', () => { + it('stable hash of well known values', () => { + expect(hash(true)).toBe(0x42108421); + expect(hash(false)).toBe(0x42108420); + expect(hash(0)).toBe(0); + expect(hash(null)).toBe(0x42108422); + expect(hash(undefined)).toBe(0x42108423); + expect(hash('a')).toBe(97); + expect(hash('immutable-js')).toBe(510203252); + expect(hash(123)).toBe(123); + }); + + it('generates different hashes for decimal values', () => { + expect(hash(123.456)).toBe(884763256); + expect(hash(123.4567)).toBe(887769707); + }); + + it('generates different hashes for different objects', () => { + const objA = {}; + const objB = {}; + expect(hash(objA)).toBe(hash(objA)); + expect(hash(objA)).not.toBe(hash(objB)); + }); + + it('generates different hashes for different symbols', () => { + const symA = Symbol(); + + const symB = Symbol(); + expect(hash(symA)).toBe(hash(symA)); + expect(hash(symA)).not.toBe(hash(symB)); + }); + + it('generates different hashes for different functions', () => { + const funA = () => {}; + const funB = () => {}; + expect(hash(funA)).toBe(hash(funA)); + expect(hash(funA)).not.toBe(hash(funB)); + }); + + const genValue = fc.oneof(fc.string(), fc.integer()); + + it('generates unsigned 31-bit integers', () => { + fc.assert( + fc.property(genValue, (value) => { + const hashVal = hash(value); + expect(Number.isInteger(hashVal)).toBe(true); + expect(hashVal).toBeGreaterThan(-(2 ** 31)); + expect(hashVal).toBeLessThan(2 ** 31); + }) + ); + }); +}); diff --git a/__tests__/interpose.ts b/__tests__/interpose.ts index b1d3c29d21..a3698628af 100644 --- a/__tests__/interpose.ts +++ b/__tests__/interpose.ts @@ -1,24 +1,17 @@ -/// -/// - -jest.autoMockOff(); - -import I = require('immutable'); +import { describe, expect, it } from '@jest/globals'; +import { Range } from 'immutable'; describe('interpose', () => { - it('separates with a value', () => { - var range = I.Range(10, 15); - var interposed = range.interpose(0); - expect(interposed.toArray()).toEqual( - [ 10, 0, 11, 0, 12, 0, 13, 0, 14 ] - ); - }) + const range = Range(10, 15); + const interposed = range.interpose(0); + expect(interposed.toArray()).toEqual([10, 0, 11, 0, 12, 0, 13, 0, 14]); + }); it('can be iterated', () => { - var range = I.Range(10, 15); - var interposed = range.interpose(0); - var values = interposed.values(); + const range = Range(10, 15); + const interposed = range.interpose(0); + const values = interposed.values(); expect(values.next()).toEqual({ value: 10, done: false }); expect(values.next()).toEqual({ value: 0, done: false }); expect(values.next()).toEqual({ value: 11, done: false }); @@ -29,6 +22,5 @@ describe('interpose', () => { expect(values.next()).toEqual({ value: 0, done: false }); expect(values.next()).toEqual({ value: 14, done: false }); expect(values.next()).toEqual({ value: undefined, done: true }); - }) - -}) + }); +}); diff --git a/__tests__/issues.ts b/__tests__/issues.ts new file mode 100644 index 0000000000..e283378cfc --- /dev/null +++ b/__tests__/issues.ts @@ -0,0 +1,185 @@ +import { describe, expect, it } from '@jest/globals'; +import { + fromJS, + List, + Map, + OrderedMap, + OrderedSet, + Record, + Seq, + Set, +} from 'immutable'; + +describe('Issue #1175', () => { + it('invalid hashCode() response should not infinitly recurse', () => { + class BadHash { + equals() { + return false; + } + + hashCode() { + return 2 ** 32; + } + } + + const set = Set([new BadHash()]); + expect(set.size).toEqual(1); + }); +}); + +describe('Issue #1188', () => { + it('Removing items from OrderedSet should return OrderedSet', () => { + const orderedSet = OrderedSet(['one', 'two', 'three']); + const emptyOrderedSet = orderedSet.subtract(['two', 'three', 'one']); + expect(OrderedSet.isOrderedSet(emptyOrderedSet)).toBe(true); + }); +}); + +describe('Issue #1220 : Seq.rest() throws an exception when invoked on a single item sequence', () => { + it('should be iterable', () => { + // Helper for this test + const ITERATOR_SYMBOL = + (typeof Symbol === 'function' && Symbol.iterator) || '@@iterator'; + + const r = Seq([1]).rest(); + const i = r[ITERATOR_SYMBOL](); + expect(i.next()).toEqual({ value: undefined, done: true }); + }); +}); + +describe('Issue #1245', () => { + it('should return empty collection after takeLast(0)', () => { + const size = List(['a', 'b', 'c']).takeLast(0).size; + expect(size).toEqual(0); + }); +}); + +describe('Issue #1262', () => { + it('Set.subtract should accept an array', () => { + const MyType = Record({ val: 1 }); + const set1 = Set([ + MyType({ val: 1 }), + MyType({ val: 2 }), + MyType({ val: 3 }), + ]); + const set2 = set1.subtract([MyType({ val: 2 })]); + const set3 = set1.subtract(List([MyType({ val: 2 })])); + expect(set2).toEqual(set3); + }); +}); + +describe('Issue #1287', () => { + it('should skip all items in OrderedMap when skipping Infinity', () => { + const size = OrderedMap([['a', 1]]).skip(Infinity).size; + expect(size).toEqual(0); + }); +}); + +describe('Issue #1247', () => { + it('Records should not be considered altered after creation', () => { + const R = Record({ a: 1 }); + const r = new R(); + expect(r.wasAltered()).toBe(false); + }); +}); + +describe('Issue #1252', () => { + it('should be toString-able even if it contains a value which is not', () => { + const prototypelessObj = Object.create(null); + const list = List([prototypelessObj]); + expect(list.toString()).toBe('List [ {} ]'); + }); +}); + +describe('Issue #1293', () => { + it('merge() should not deeply coerce values', () => { + type StateObject = { foo: string | { qux: string }; biz?: string }; + const State = Record({ foo: 'bar', biz: 'baz' }); + const deepObject = { qux: 'quux' }; + + const firstState = State({ foo: deepObject }); + const secondState = State().merge({ foo: deepObject }); + + expect(secondState).toEqual(firstState); + }); +}); + +describe('Issue #1643', () => { + [ + ['a string', 'test'], + ['a number', 5], + ['null', null], + ['undefined', undefined], + ['a boolean', true], + ['an object', {}], + ['an array', []], + ['a function', () => null], + ].forEach(([label, value]) => { + class MyClass { + valueOf() { + return value; + } + } + + it(`Collection#hashCode() should handle objects that return ${label} for valueOf`, () => { + const set = Set().add(new MyClass()); + expect(() => set.hashCode()).not.toThrow(); + }); + }); +}); + +describe('Issue #1785', () => { + it('merge() should not return undefined', () => { + const emptyRecord = Record({})(); + + expect(emptyRecord.merge({ id: 1 })).toBe(emptyRecord); + }); +}); + +describe('Issue #1475', () => { + it('complex case should return first value on mergeDeep when types are incompatible', () => { + const a = fromJS({ + ch: [ + { + code: 8, + }, + ], + }) as Map; + const b = fromJS({ + ch: { + code: 8, + }, + }); + expect(a.mergeDeep(b).equals(b)).toBe(true); + }); + + it('simple case should return first value on mergeDeep when types are incompatible', () => { + const a = fromJS({ + ch: [], + }) as Map; + const b = fromJS({ + ch: { code: 8 }, + }); + expect(a.merge(b).equals(b)).toBe(true); + }); +}); + +describe('Issue #1719', () => { + it('mergeDeep() should overwrite when types conflict', () => { + const objWithObj = fromJS({ + items: { + '1': { + id: '1', + }, + }, + }) as Map; + const objWithArray = fromJS({ + items: [ + { + id: '1', + }, + ], + }); + expect(objWithObj.mergeDeep(objWithArray).equals(objWithArray)).toBe(true); + }); +}); diff --git a/__tests__/join.ts b/__tests__/join.ts index 31d5f7d06a..4d6d472835 100644 --- a/__tests__/join.ts +++ b/__tests__/join.ts @@ -1,35 +1,52 @@ -/// -/// - -jest.autoMockOff(); - -import I = require('immutable'); - -import jasmineCheck = require('jasmine-check'); -jasmineCheck.install(); +import { describe, expect, it } from '@jest/globals'; +import { Seq } from 'immutable'; +import fc from 'fast-check'; describe('join', () => { - it('string-joins sequences with commas by default', () => { - expect(I.Seq.of(1,2,3,4,5).join()).toBe('1,2,3,4,5'); - }) + expect(Seq([1, 2, 3, 4, 5]).join()).toBe('1,2,3,4,5'); + }); it('string-joins sequences with any string', () => { - expect(I.Seq.of(1,2,3,4,5).join('foo')).toBe('1foo2foo3foo4foo5'); - }) + expect(Seq([1, 2, 3, 4, 5]).join('foo')).toBe('1foo2foo3foo4foo5'); + }); it('string-joins sequences with empty string', () => { - expect(I.Seq.of(1,2,3,4,5).join('')).toBe('12345'); - }) + expect(Seq([1, 2, 3, 4, 5]).join('')).toBe('12345'); + }); it('joins sparse-sequences like Array.join', () => { - var a = [1,,2,,3,,4,,5,,,]; - expect(I.Seq(a).join()).toBe(a.join()); - }) - - check.it('behaves the same as Array.join', - [gen.array(gen.primitive), gen.primitive], (array, joiner) => { - expect(I.Seq(array).join(joiner)).toBe(array.join(joiner)); - }) - -}) + const a = [ + 1, + undefined, + 2, + undefined, + 3, + undefined, + 4, + undefined, + 5, + undefined, + undefined, + ]; + expect(Seq(a).join()).toBe(a.join()); + }); + + const genPrimitive = fc.oneof( + fc.string(), + fc.integer(), + fc.boolean(), + fc.constant(null), + fc.constant(undefined), + fc.constant(NaN) + ); + + it('behaves the same as Array.join', () => { + fc.assert( + fc.property(fc.array(genPrimitive), genPrimitive, (array, joiner) => { + // @ts-expect-error unexpected values for typescript joiner, but valid at runtime despite the unexpected errors + expect(Seq(array).join(joiner)).toBe(array.join(joiner)); + }) + ); + }); +}); diff --git a/__tests__/merge.ts b/__tests__/merge.ts index 1c16e1fd04..14e934b4c0 100644 --- a/__tests__/merge.ts +++ b/__tests__/merge.ts @@ -1,137 +1,349 @@ -/// -/// - -jest.autoMockOff(); - -import I = require('immutable'); - -declare function expect(val: any): ExpectWithIs; - -interface ExpectWithIs extends Expect { - is(expected: any): void; - not: ExpectWithIs; -} +import { describe, expect, it } from '@jest/globals'; +import { + fromJS, + List, + Map, + merge, + mergeDeep, + mergeDeepWith, + Record, + Set, +} from 'immutable'; describe('merge', () => { - - beforeEach(function () { - this.addMatchers({ - is: function(expected) { - return I.is(this.actual, expected); - } - }) - }) - it('merges two maps', () => { - var m1 = I.Map({a:1,b:2,c:3}); - var m2 = I.Map({d:10,b:20,e:30}); - expect(m1.merge(m2)).is(I.Map({a:1,b:20,c:3,d:10,e:30})); - }) + const m1 = Map({ a: 1, b: 2, c: 3 }); + const m2 = Map({ d: 10, b: 20, e: 30 }); + expect(m1.merge(m2)).toEqual(Map({ a: 1, b: 20, c: 3, d: 10, e: 30 })); + }); it('can merge in an explicitly undefined value', () => { - var m1 = I.Map({a:1,b:2}); - var m2 = I.Map({a:undefined}); - expect(m1.merge(m2)).is(I.Map({a:undefined,b:2})); - }) + const m1 = Map({ a: 1, b: 2 }); + const m2 = Map({ a: undefined }); + expect(m1.merge(m2)).toEqual(Map({ a: undefined, b: 2 })); + }); it('merges two maps with a merge function', () => { - var m1 = I.Map({a:1,b:2,c:3}); - var m2 = I.Map({d:10,b:20,e:30}); - expect(m1.mergeWith((a, b) => a + b, m2)).is(I.Map({a:1,b:22,c:3,d:10,e:30})); - }) + const m1 = Map({ a: 1, b: 2, c: 3 }); + const m2 = Map({ d: 10, b: 20, e: 30 }); + expect(m1.mergeWith((a: number, b: number) => a + b, m2)).toEqual( + Map({ a: 1, b: 22, c: 3, d: 10, e: 30 }) + ); + }); + + it('throws typeError without merge function', () => { + const m1 = Map({ a: 1, b: 2, c: 3 }); + const m2 = Map({ d: 10, b: 20, e: 30 }); + // @ts-expect-error -- test that runtime does throw + expect(() => m1.mergeWith(1, m2)).toThrow(TypeError); + }); it('provides key as the third argument of merge function', () => { - var m1 = I.Map({id:'temp', b:2, c:3}); - var m2 = I.Map({id:10, b:20, e:30}); - var add = (a, b) => a + b + const m1 = Map({ id: 'temp', b: 2, c: 3 }); + const m2 = Map({ id: 10, b: 20, e: 30 }); + const add = (a: number, b: number) => a + b; expect( - m1.mergeWith((a, b, key) => key !== 'id' ? add(a, b) : b, m2) - ).is(I.Map({id:10,b:22,c:3,e:30})); - }) + // @ts-expect-error -- it's difficult to type `a` not as `string | number` + m1.mergeWith((a, b, key) => (key !== 'id' ? add(a, b) : b), m2) + ).toEqual(Map({ id: 10, b: 22, c: 3, e: 30 })); + }); it('deep merges two maps', () => { - var m1 = I.fromJS({a:{b:{c:1,d:2}}}); - var m2 = I.fromJS({a:{b:{c:10,e:20},f:30},g:40}); - expect(m1.mergeDeep(m2)).is(I.fromJS({a:{b:{c:10,d:2,e:20},f:30},g:40})); - }) + const m1 = fromJS({ a: { b: { c: 1, d: 2 } } }); + const m2 = fromJS({ a: { b: { c: 10, e: 20 }, f: 30 }, g: 40 }); + expect(m1.mergeDeep(m2)).toEqual( + fromJS({ a: { b: { c: 10, d: 2, e: 20 }, f: 30 }, g: 40 }) + ); + }); + + it('merge uses === for return-self optimization', () => { + const date1 = new Date(1234567890000); + // Value equal, but different reference. + const date2 = new Date(1234567890000); + const m = Map().set('a', date1); + expect(m.merge({ a: date2 })).not.toBe(m); + expect(m.merge({ a: date1 })).toBe(m); + }); + + it('deep merge uses === for return-self optimization', () => { + const date1 = new Date(1234567890000); + // Value equal, but different reference. + const date2 = new Date(1234567890000); + const m = Map().setIn(['a', 'b', 'c'], date1); + expect(m.mergeDeep({ a: { b: { c: date2 } } })).not.toBe(m); + expect(m.mergeDeep({ a: { b: { c: date1 } } })).toBe(m); + }); it('deep merges raw JS', () => { - var m1 = I.fromJS({a:{b:{c:1,d:2}}}); - var js = {a:{b:{c:10,e:20},f:30},g:40}; - expect(m1.mergeDeep(js)).is(I.fromJS({a:{b:{c:10,d:2,e:20},f:30},g:40})); - }) + const m1 = fromJS({ a: { b: { c: 1, d: 2 } } }); + const js = { a: { b: { c: 10, e: 20 }, f: 30 }, g: 40 }; + expect(m1.mergeDeep(js)).toEqual( + fromJS({ a: { b: { c: 10, d: 2, e: 20 }, f: 30 }, g: 40 }) + ); + }); it('deep merges raw JS with a merge function', () => { - var m1 = I.fromJS({a:{b:{c:1,d:2}}}); - var js = {a:{b:{c:10,e:20},f:30},g:40}; - expect( - m1.mergeDeepWith((a, b) => a + b, js) - ).is(I.fromJS( - {a:{b:{c:11,d:2,e:20},f:30},g:40} - )); - }) + const m1 = fromJS({ a: { b: { c: 1, d: 2 } } }); + const js = { a: { b: { c: 10, e: 20 }, f: 30 }, g: 40 }; + // @ts-expect-error type of `mergeDeepWith` is too lazy for now + expect(m1.mergeDeepWith((a: number, b: number) => a + b, js)).toEqual( + fromJS({ a: { b: { c: 11, d: 2, e: 20 }, f: 30 }, g: 40 }) + ); + }); + + it('deep merges raw JS into raw JS with a merge function', () => { + const js1 = { a: { b: { c: 1, d: 2 } } }; + const js2 = { a: { b: { c: 10, e: 20 }, f: 30 }, g: 40 }; + // @ts-expect-error type of `mergeDeepWith` is too lazy for now + expect(mergeDeepWith((a: number, b: number) => a + b, js1, js2)).toEqual({ + a: { b: { c: 11, d: 2, e: 20 }, f: 30 }, + g: 40, + }); + }); + + it('deep merges collections into raw JS with a merge function', () => { + const js = { a: { b: { c: 1, d: 2 } } }; + const m = fromJS({ a: { b: { c: 10, e: 20 }, f: 30 }, g: 40 }); + // @ts-expect-error type of `mergeDeepWith` is too lazy for now + expect(mergeDeepWith((a: number, b: number) => a + b, js, m)).toEqual({ + a: { b: { c: 11, d: 2, e: 20 }, f: 30 }, + g: 40, + }); + }); it('returns self when a deep merges is a no-op', () => { - var m1 = I.fromJS({a:{b:{c:1,d:2}}}); - expect( - m1.mergeDeep({a:{b:{c:1}}}) - ).toBe(m1); - }) + const m1 = fromJS({ a: { b: { c: 1, d: 2 } } }); + expect(m1.mergeDeep({ a: { b: { c: 1 } } })).toBe(m1); + }); it('returns arg when a deep merges is a no-op', () => { - var m1 = I.fromJS({a:{b:{c:1,d:2}}}); - expect( - I.Map().mergeDeep(m1) - ).toBe(m1); - }) + const m1 = fromJS({ a: { b: { c: 1, d: 2 } } }); + expect(Map().mergeDeep(m1)).toBe(m1); + }); + + it('returns self when a deep merges is a no-op on raw JS', () => { + const m1 = { a: { b: { c: 1, d: 2 } } }; + expect(mergeDeep(m1, { a: { b: { c: 1 } } })).toBe(m1); + }); it('can overwrite existing maps', () => { expect( - I.fromJS({ a: { x: 1, y: 1 }, b: { x: 2, y: 2 } }) - .merge({ a: null, b: { x: 10 } }) - .toJS() - ).toEqual( - { a: null, b: { x: 10 } } - ); + fromJS({ a: { x: 1, y: 1 }, b: { x: 2, y: 2 } }).merge({ + a: null, + b: Map({ x: 10 }), + }) + ).toEqual(fromJS({ a: null, b: { x: 10 } })); expect( - I.fromJS({ a: { x: 1, y: 1 }, b: { x: 2, y: 2 } }) - .mergeDeep({ a: null, b: { x: 10 } }) - .toJS() - ).toEqual( - { a: null, b: { x: 10, y: 2 } } - ); - }) + fromJS({ a: { x: 1, y: 1 }, b: { x: 2, y: 2 } }).mergeDeep({ + a: null, + b: { x: 10 }, + }) + ).toEqual(fromJS({ a: null, b: { x: 10, y: 2 } })); + }); it('can overwrite existing maps with objects', () => { - var m1 = I.fromJS({ a: { x: 1, y: 1 } }); // deep conversion. - var m2 = I.Map({ a: { z: 10 } }); // shallow conversion to Map. + const m1 = fromJS({ a: { x: 1, y: 1 } }); // deep conversion. + const m2 = Map({ a: { z: 10 } }); // shallow conversion to Map. - // raw object simply replaces map. - expect(m1.merge(m2).get('a')).toEqual({z: 10}) // raw object. - expect(m1.mergeDeep(m2).get('a')).toEqual({z: 10}) // raw object. - }) + // Raw object simply replaces map. + expect(m1.merge(m2).get('a')).toEqual({ z: 10 }); // raw object. + // However, mergeDeep will merge that value into the inner Map. + expect(m1.mergeDeep(m2).get('a')).toEqual(Map({ x: 1, y: 1, z: 10 })); + }); - it('merges map entries with Vector values', () => { - expect( - I.fromJS({a:[1]}).merge({b:[2]}) - ).is(I.fromJS( - {a:[1], b:[2]} - )); - expect( - I.fromJS({a:[1]}).mergeDeep({b:[2]}) - ).is(I.fromJS( - {a:[1], b:[2]} - )); - }) + it('merges map entries with List and Set values', () => { + const initial = Map({ + a: Map({ x: 10, y: 20 }), + b: List([1, 2, 3]), + c: Set([1, 2, 3]), + }); + const additions = Map({ + a: Map({ y: 50, z: 100 }), + b: List([4, 5, 6]), + c: Set([4, 5, 6]), + }); + expect(initial.mergeDeep(additions)).toEqual( + Map({ + a: Map({ x: 10, y: 50, z: 100 }), + b: List([1, 2, 3, 4, 5, 6]), + c: Set([1, 2, 3, 4, 5, 6]), + }) + ); + }); + + it('merges map entries with new values', () => { + const initial = Map({ a: List([1]) }); + + // Note: merge and mergeDeep do not deeply coerce values, they only merge + // with what's there prior. + expect(initial.merge({ b: [2] })).toEqual(Map({ a: List([1]), b: [2] })); + expect(initial.mergeDeep({ b: [2] })).toEqual( + fromJS(Map({ a: List([1]), b: [2] })) + ); + }); it('maintains JS values inside immutable collections', () => { - var m1 = I.fromJS({a:{b:[{imm:'map'}]}}); - var m2 = m1.mergeDeep( - I.Map({a: I.Map({b: I.List.of( {plain:'obj'} )})}) + const m1 = fromJS({ a: { b: { imm: 'map' } } }); + const m2 = m1.mergeDeep(Map({ a: Map({ b: { plain: 'obj' } }) })); + + expect(m1.getIn(['a', 'b'])).toEqual(Map([['imm', 'map']])); + // However mergeDeep will merge that value into the inner Map + expect(m2.getIn(['a', 'b'])).toEqual(Map({ imm: 'map', plain: 'obj' })); + }); + + it('merges plain Objects', () => { + expect(merge({ x: 1, y: 1 }, { y: 2, z: 2 }, Map({ z: 3, q: 3 }))).toEqual({ + x: 1, + y: 2, + z: 3, + q: 3, + }); + }); + + it('merges plain Arrays', () => { + expect(merge([1, 2], [3, 4], List([5, 6]))).toEqual([1, 2, 3, 4, 5, 6]); + }); + + it('merging plain Array returns self after no-op', () => { + const a = [1, 2, 3]; + expect(merge(a, [], [])).toBe(a); + }); + + it('merges records with a size property set to 0', () => { + const Sizable = Record({ size: 0 }); + expect(Sizable().merge({ size: 123 }).size).toBe(123); + }); + + it('mergeDeep merges partial conflicts', () => { + const a = fromJS({ + ch: [ + { + code: 8, + }, + ], + banana: 'good', + }) as Map; + const b = fromJS({ + ch: { + code: 8, + }, + apple: 'anti-doctor', + }); + expect( + a.mergeDeep(b).equals( + fromJS({ + ch: { + code: 8, + }, + apple: 'anti-doctor', + banana: 'good', + }) + ) + ).toBe(true); + }); + + const map = { type: 'Map', value: Map({ b: 5, c: 9 }) }; + const object = { type: 'object', value: { b: 7, d: 12 } }; + const RecordFactory = Record({ a: 1, b: 2 }); + const record = { type: 'Record', value: RecordFactory({ b: 3 }) }; + const list = { type: 'List', value: List(['5']) }; + const array = { type: 'array', value: ['9'] }; + const set = { type: 'Set', value: Set('3') }; + + const incompatibleTypes = [ + [map, list], + [map, array], + [map, set], + [object, list], + [object, array], + [object, set], + [record, list], + [record, array], + [record, set], + [list, set], + ]; + + for (const [ + { type: type1, value: value1 }, + { type: type2, value: value2 }, + ] of incompatibleTypes) { + it(`mergeDeep and Map#mergeDeep replaces ${type1} and ${type2} with each other`, () => { + const aObject = { a: value1 }; + const bObject = { a: value2 }; + expect(mergeDeep(aObject, bObject)).toEqual(bObject); + expect(mergeDeep(bObject, aObject)).toEqual(aObject); + + const aMap = Map({ a: value1 }); + const bMap = Map({ a: value2 }); + expect(aMap.mergeDeep(bMap).equals(bMap)).toBe(true); + expect(bMap.mergeDeep(aMap).equals(aMap)).toBe(true); + }); + } + + const compatibleTypesAndResult = [ + [map, object, Map({ b: 7, c: 9, d: 12 })], + [map, record, Map({ a: 1, b: 3, c: 9 })], + [object, map, { b: 5, c: 9, d: 12 }], + [object, record, { a: 1, b: 3, d: 12 }], + [record, map, RecordFactory({ b: 5 })], + [record, object, RecordFactory({ b: 7 })], + [list, array, List(['5', '9'])], + [array, list, ['9', '5']], + [map, { type: 'Map', value: Map({ b: 7 }) }, Map({ b: 7, c: 9 })], + [object, { type: 'object', value: { d: 3 } }, { b: 7, d: 3 }], + [ + record, + { type: 'Record', value: RecordFactory({ a: 3 }) }, + RecordFactory({ a: 3, b: 2 }), + ], + [list, { type: 'List', value: List(['12']) }, List(['5', '12'])], + [array, { type: 'array', value: ['3'] }, ['9', '3']], + [set, { type: 'Set', value: Set(['3', '5']) }, Set(['3', '5'])], + ] as const; + + for (const [ + { type: type1, value: value1 }, + { type: type2, value: value2 }, + result, + ] of compatibleTypesAndResult) { + it(`mergeDeep and Map#mergeDeep merges ${type1} and ${type2}`, () => { + const aObject = { a: value1 }; + const bObject = { a: value2 }; + expect(mergeDeep(aObject, bObject)).toEqual({ a: result }); + + const aMap = Map({ a: value1 }); + const bMap = Map({ a: value2 }); + expect(aMap.mergeDeep(bMap)).toEqual(Map({ a: result })); + }); + } + + it('Map#mergeDeep replaces nested List with Map and Map with List', () => { + const a = Map({ a: List([Map({ x: 1 })]) }); + const b = Map({ a: Map([[0, Map({ y: 2 })]]) }); + expect(a.mergeDeep(b).equals(b)).toBe(true); + expect(b.mergeDeep(a).equals(a)).toBe(true); + }); + + it('functional mergeDeep replaces nested array with Map', () => { + const a = { a: [{ x: 1 }] }; + const b = Map({ a: Map([[0, Map({ y: 2 })]]) }); + expect(mergeDeep(a, b)).toEqual({ a: Map([[0, Map({ y: 2 })]]) }); + }); + + it('works with an empty Record', () => { + class MyRecord extends Record({ a: 1 }) {} + + const myRecord = new MyRecord(); + expect(merge(myRecord, { a: 4 })).toEqual( + new MyRecord({ + a: 4, + }) ); - expect(m1.getIn(['a', 'b', 0])).is(I.Map([['imm', 'map']])); - expect(m2.getIn(['a', 'b', 0])).toEqual({plain: 'obj'}); - }) + class MyEmptyRecord extends Record({}) {} -}) + const myEmptyRecord = new MyEmptyRecord(); + // merging with an empty record should return the same empty record instance + expect(merge(myEmptyRecord, { a: 4 })).toBe(myEmptyRecord); + }); +}); diff --git a/__tests__/minmax.ts b/__tests__/minmax.ts index 8a9a8532de..9a4c7a3c59 100644 --- a/__tests__/minmax.ts +++ b/__tests__/minmax.ts @@ -1,128 +1,126 @@ -/// -/// +import { describe, expect, it } from '@jest/globals'; +import { is, Seq } from 'immutable'; +import fc from 'fast-check'; -jest.autoMockOff(); - -import jasmineCheck = require('jasmine-check'); -jasmineCheck.install(); - -import I = require('immutable'); -import Seq = I.Seq; - -var genHeterogeneousishArray = gen.oneOf([ - gen.array(gen.oneOf([gen.string, gen.undefined])), - gen.array(gen.oneOf([gen.int, gen.NaN])) -]); +const genHeterogeneousishArray = fc.oneof( + fc.sparseArray(fc.string()), + fc.array(fc.oneof(fc.integer(), fc.constant(NaN))) +); describe('max', () => { - it('returns max in a sequence', () => { - expect(Seq([1,9,2,8,3,7,4,6,5]).max()).toBe(9); + expect(Seq([1, 9, 2, 8, 3, 7, 4, 6, 5]).max()).toBe(9); }); it('accepts a comparator', () => { - expect(Seq([1,9,2,8,3,7,4,6,5]).max((a, b) => b - a)).toBe(1); + expect(Seq([1, 9, 2, 8, 3, 7, 4, 6, 5]).max((a, b) => b - a)).toBe(1); }); it('by a mapper', () => { - var family = I.Seq([ + const family = Seq([ { name: 'Oakley', age: 7 }, { name: 'Dakota', age: 7 }, { name: 'Casey', age: 34 }, { name: 'Avery', age: 34 }, - ]) - expect(family.maxBy(p => p.age).name).toBe('Casey'); + ]); + expect(family.maxBy((p) => p.age)).toBe(family.get(2)); }); it('by a mapper and a comparator', () => { - var family = I.Seq([ + const family = Seq([ { name: 'Oakley', age: 7 }, { name: 'Dakota', age: 7 }, { name: 'Casey', age: 34 }, { name: 'Avery', age: 34 }, - ]) - expect(family.maxBy(p => p.age, (a, b) => b - a).name).toBe('Oakley'); + ]); + expect( + family.maxBy( + (p) => p.age, + (a, b) => b - a + ) + ).toBe(family.get(0)); }); it('surfaces NaN, null, and undefined', () => { - expect( - I.is(NaN, I.Seq.of(1, 2, 3, 4, 5, NaN).max()) - ).toBe(true); - expect( - I.is(NaN, I.Seq.of(NaN, 1, 2, 3, 4, 5).max()) - ).toBe(true); - expect( - I.is(null, I.Seq.of('A', 'B', 'C', 'D', null).max()) - ).toBe(true); - expect( - I.is(null, I.Seq.of(null, 'A', 'B', 'C', 'D').max()) - ).toBe(true); + expect(is(NaN, Seq([1, 2, 3, 4, 5, NaN]).max())).toBe(true); + expect(is(NaN, Seq([NaN, 1, 2, 3, 4, 5]).max())).toBe(true); + expect(is(null, Seq(['A', 'B', 'C', 'D', null]).max())).toBe(true); + expect(is(null, Seq([null, 'A', 'B', 'C', 'D']).max())).toBe(true); }); it('null treated as 0 in default iterator', () => { - expect( - I.is(2, I.Seq.of(-1, -2, null, 1, 2).max()) - ).toBe(true); + expect(is(2, Seq([-1, -2, null, 1, 2]).max())).toBe(true); }); - check.it('is not dependent on order', [genHeterogeneousishArray], vals => { - expect( - I.is( - I.Seq(shuffle(vals.slice())).max(), - I.Seq(vals).max() - ) - ).toEqual(true); + it('is not dependent on order', () => { + fc.assert( + fc.property(genHeterogeneousishArray, (vals) => { + expect( + is( + Seq(shuffle(vals.slice())).max(), + Seq(vals).max() + ) + ).toEqual(true); + }) + ); }); - }); describe('min', () => { - it('returns min in a sequence', () => { - expect(Seq([1,9,2,8,3,7,4,6,5]).min()).toBe(1); + expect(Seq([1, 9, 2, 8, 3, 7, 4, 6, 5]).min()).toBe(1); }); it('accepts a comparator', () => { - expect(Seq([1,9,2,8,3,7,4,6,5]).min((a, b) => b - a)).toBe(9); + expect(Seq([1, 9, 2, 8, 3, 7, 4, 6, 5]).min((a, b) => b - a)).toBe(9); }); it('by a mapper', () => { - var family = I.Seq([ + const family = Seq([ { name: 'Oakley', age: 7 }, { name: 'Dakota', age: 7 }, { name: 'Casey', age: 34 }, { name: 'Avery', age: 34 }, - ]) - expect(family.minBy(p => p.age).name).toBe('Oakley'); + ]); + expect(family.minBy((p) => p.age)).toBe(family.get(0)); }); it('by a mapper and a comparator', () => { - var family = I.Seq([ + const family = Seq([ { name: 'Oakley', age: 7 }, { name: 'Dakota', age: 7 }, { name: 'Casey', age: 34 }, { name: 'Avery', age: 34 }, - ]) - expect(family.minBy(p => p.age, (a, b) => b - a).name).toBe('Casey'); - }); - - check.it('is not dependent on order', [genHeterogeneousishArray], vals => { + ]); expect( - I.is( - I.Seq(shuffle(vals.slice())).min(), - I.Seq(vals).min() + family.minBy( + (p) => p.age, + (a, b) => b - a ) - ).toEqual(true); + ).toBe(family.get(2)); }); + it('is not dependent on order', () => { + fc.assert( + fc.property(genHeterogeneousishArray, (vals) => { + expect( + is( + Seq(shuffle(vals.slice())).min(), + Seq(vals).min() + ) + ).toEqual(true); + }) + ); + }); }); -function shuffle(array) { - var m = array.length, t, i; +function shuffle>(array: A): A { + let m = array.length; + let t; + let i; // While there remain elements to shuffle… while (m) { - // Pick a remaining element… i = Math.floor(Math.random() * m--); diff --git a/__tests__/partition.ts b/__tests__/partition.ts new file mode 100644 index 0000000000..0a59b3d8ec --- /dev/null +++ b/__tests__/partition.ts @@ -0,0 +1,102 @@ +import { beforeEach, describe, expect, it, jest } from '@jest/globals'; +import { + isAssociative, + isIndexed, + isKeyed, + isList, + isMap, + isSeq, + isSet, + List, + Map as IMap, + Seq, + Set as ISet, +} from 'immutable'; + +describe('partition', () => { + let isOdd: jest.Mock<(x: number) => number>; + + beforeEach(() => { + isOdd = jest.fn((x) => x % 2); + }); + + it('partitions keyed sequence', () => { + const parts = Seq({ a: 1, b: 2, c: 3, d: 4 }).partition(isOdd); + expect(isKeyed(parts[0])).toBe(true); + expect(isSeq(parts[0])).toBe(true); + expect(parts.map((part) => part.toJS())).toEqual([ + { b: 2, d: 4 }, + { a: 1, c: 3 }, + ]); + expect(isOdd.mock.calls.length).toBe(4); + + // Each group should be a keyed sequence, not an indexed sequence + const trueGroup = parts[1]; + expect(trueGroup && trueGroup.toArray()).toEqual([ + ['a', 1], + ['c', 3], + ]); + }); + + it('partitions indexed sequence', () => { + const parts = Seq([1, 2, 3, 4, 5, 6]).partition(isOdd); + expect(isIndexed(parts[0])).toBe(true); + expect(isSeq(parts[0])).toBe(true); + expect(parts.map((part) => part.toJS())).toEqual([ + [2, 4, 6], + [1, 3, 5], + ]); + expect(isOdd.mock.calls.length).toBe(6); + }); + + it('partitions set sequence', () => { + const parts = Seq.Set([1, 2, 3, 4, 5, 6]).partition(isOdd); + expect(isAssociative(parts[0])).toBe(false); + expect(isSeq(parts[0])).toBe(true); + expect(parts.map((part) => part.toJS())).toEqual([ + [2, 4, 6], + [1, 3, 5], + ]); + expect(isOdd.mock.calls.length).toBe(6); + }); + + it('partitions keyed collection', () => { + const parts = IMap({ a: 1, b: 2, c: 3, d: 4 }).partition(isOdd); + expect(isMap(parts[0])).toBe(true); + expect(isSeq(parts[0])).toBe(false); + expect(parts.map((part) => part.toJS())).toEqual([ + { b: 2, d: 4 }, + { a: 1, c: 3 }, + ]); + expect(isOdd.mock.calls.length).toBe(4); + + // Each group should be a keyed collection, not an indexed collection + const trueGroup = parts[1]; + expect(trueGroup && trueGroup.toArray()).toEqual([ + ['a', 1], + ['c', 3], + ]); + }); + + it('partitions indexed collection', () => { + const parts = List([1, 2, 3, 4, 5, 6]).partition(isOdd); + expect(isList(parts[0])).toBe(true); + expect(isSeq(parts[0])).toBe(false); + expect(parts.map((part) => part.toJS())).toEqual([ + [2, 4, 6], + [1, 3, 5], + ]); + expect(isOdd.mock.calls.length).toBe(6); + }); + + it('partitions set collection', () => { + const parts = ISet([1, 2, 3, 4, 5, 6]).partition(isOdd); + expect(isSet(parts[0])).toBe(true); + expect(isSeq(parts[0])).toBe(false); + expect(parts.map((part) => part.toJS().sort())).toEqual([ + [2, 4, 6], + [1, 3, 5], + ]); + expect(isOdd.mock.calls.length).toBe(6); + }); +}); diff --git a/__tests__/slice.ts b/__tests__/slice.ts index bcad2a8ed5..07b763ff58 100644 --- a/__tests__/slice.ts +++ b/__tests__/slice.ts @@ -1,158 +1,299 @@ -/// -/// - -jest.autoMockOff(); - -import jasmineCheck = require('jasmine-check'); -jasmineCheck.install(); - -import I = require('immutable'); -import Seq = I.Seq; -import List = I.List; +import { describe, expect, it } from '@jest/globals'; +import { List, Range, Seq } from 'immutable'; +import fc from 'fast-check'; describe('slice', () => { - it('slices a sequence', () => { - expect(Seq.of(1,2,3,4,5,6).slice(2).toArray()).toEqual([3,4,5,6]); - expect(Seq.of(1,2,3,4,5,6).slice(2, 4).toArray()).toEqual([3,4]); - expect(Seq.of(1,2,3,4,5,6).slice(-3, -1).toArray()).toEqual([4,5]); - expect(Seq.of(1,2,3,4,5,6).slice(-1).toArray()).toEqual([6]); - expect(Seq.of(1,2,3,4,5,6).slice(0, -1).toArray()).toEqual([1,2,3,4,5]); - }) + expect(Seq([1, 2, 3, 4, 5, 6]).slice(2).toArray()).toEqual([3, 4, 5, 6]); + expect(Seq([1, 2, 3, 4, 5, 6]).slice(2, 4).toArray()).toEqual([3, 4]); + expect(Seq([1, 2, 3, 4, 5, 6]).slice(-3, -1).toArray()).toEqual([4, 5]); + expect(Seq([1, 2, 3, 4, 5, 6]).slice(-1).toArray()).toEqual([6]); + expect(Seq([1, 2, 3, 4, 5, 6]).slice(0, -1).toArray()).toEqual([ + 1, 2, 3, 4, 5, + ]); + }); it('creates an immutable stable sequence', () => { - var seq = Seq.of(1,2,3,4,5,6); - var sliced = seq.slice(2, -2); + const seq = Seq([1, 2, 3, 4, 5, 6]); + const sliced = seq.slice(2, -2); expect(sliced.toArray()).toEqual([3, 4]); expect(sliced.toArray()).toEqual([3, 4]); expect(sliced.toArray()).toEqual([3, 4]); - }) + }); it('slices a sparse indexed sequence', () => { - expect(Seq([1,,2,,3,,4,,5,,6]).slice(1).toArray()).toEqual([,2,,3,,4,,5,,6]); - expect(Seq([1,,2,,3,,4,,5,,6]).slice(2).toArray()).toEqual([2,,3,,4,,5,,6]); - expect(Seq([1,,2,,3,,4,,5,,6]).slice(3, -3).toArray()).toEqual([,3,,4,,]); // one trailing hole. - }) + expect( + Seq([ + 1, + undefined, + 2, + undefined, + 3, + undefined, + 4, + undefined, + 5, + undefined, + 6, + ]) + .slice(1) + .toArray() + ).toEqual([ + undefined, + 2, + undefined, + 3, + undefined, + 4, + undefined, + 5, + undefined, + 6, + ]); + expect( + Seq([ + 1, + undefined, + 2, + undefined, + 3, + undefined, + 4, + undefined, + 5, + undefined, + 6, + ]) + .slice(2) + .toArray() + ).toEqual([2, undefined, 3, undefined, 4, undefined, 5, undefined, 6]); + expect( + Seq([ + 1, + undefined, + 2, + undefined, + 3, + undefined, + 4, + undefined, + 5, + undefined, + 6, + ]) + .slice(3, -3) + .toArray() + ).toEqual([undefined, 3, undefined, 4, undefined]); // one trailing hole. + }); it('can maintain indices for an keyed indexed sequence', () => { - expect(Seq.of(1,2,3,4,5,6).toKeyedSeq().slice(2).entrySeq().toArray()).toEqual([ - [2,3], - [3,4], - [4,5], - [5,6], + expect( + Seq([1, 2, 3, 4, 5, 6]).toKeyedSeq().slice(2).entrySeq().toArray() + ).toEqual([ + [2, 3], + [3, 4], + [4, 5], + [5, 6], ]); - expect(Seq.of(1,2,3,4,5,6).toKeyedSeq().slice(2, 4).entrySeq().toArray()).toEqual([ - [2,3], - [3,4], + expect( + Seq([1, 2, 3, 4, 5, 6]).toKeyedSeq().slice(2, 4).entrySeq().toArray() + ).toEqual([ + [2, 3], + [3, 4], ]); - }) + }); it('slices an unindexed sequence', () => { - expect(Seq({a:1,b:2,c:3}).slice(1).toObject()).toEqual({b:2,c:3}); - expect(Seq({a:1,b:2,c:3}).slice(1, 2).toObject()).toEqual({b:2}); - expect(Seq({a:1,b:2,c:3}).slice(0, 2).toObject()).toEqual({a:1,b:2}); - expect(Seq({a:1,b:2,c:3}).slice(-1).toObject()).toEqual({c:3}); - expect(Seq({a:1,b:2,c:3}).slice(1, -1).toObject()).toEqual({b:2}); - }) + expect(Seq({ a: 1, b: 2, c: 3 }).slice(1).toObject()).toEqual({ + b: 2, + c: 3, + }); + expect(Seq({ a: 1, b: 2, c: 3 }).slice(1, 2).toObject()).toEqual({ b: 2 }); + expect(Seq({ a: 1, b: 2, c: 3 }).slice(0, 2).toObject()).toEqual({ + a: 1, + b: 2, + }); + expect(Seq({ a: 1, b: 2, c: 3 }).slice(-1).toObject()).toEqual({ c: 3 }); + expect(Seq({ a: 1, b: 2, c: 3 }).slice(1, -1).toObject()).toEqual({ b: 2 }); + }); it('is reversable', () => { - expect(Seq.of(1,2,3,4,5,6).slice(2).reverse().toArray()).toEqual([6,5,4,3]); - expect(Seq.of(1,2,3,4,5,6).slice(2, 4).reverse().toArray()).toEqual([4,3]); - expect(Seq.of(1,2,3,4,5,6).toKeyedSeq().slice(2).reverse().entrySeq().toArray()).toEqual([ - [5,6], - [4,5], - [3,4], - [2,3], + expect(Seq([1, 2, 3, 4, 5, 6]).slice(2).reverse().toArray()).toEqual([ + 6, 5, 4, 3, + ]); + expect(Seq([1, 2, 3, 4, 5, 6]).slice(2, 4).reverse().toArray()).toEqual([ + 4, 3, + ]); + expect( + Seq([1, 2, 3, 4, 5, 6]) + .toKeyedSeq() + .slice(2) + .reverse() + .entrySeq() + .toArray() + ).toEqual([ + [5, 6], + [4, 5], + [3, 4], + [2, 3], ]); - expect(Seq.of(1,2,3,4,5,6).toKeyedSeq().slice(2, 4).reverse().entrySeq().toArray()).toEqual([ - [3,4], - [2,3], + expect( + Seq([1, 2, 3, 4, 5, 6]) + .toKeyedSeq() + .slice(2, 4) + .reverse() + .entrySeq() + .toArray() + ).toEqual([ + [3, 4], + [2, 3], ]); - }) + }); it('slices a list', () => { - expect(List.of(1,2,3,4,5,6).slice(2).toArray()).toEqual([3,4,5,6]); - expect(List.of(1,2,3,4,5,6).slice(2, 4).toArray()).toEqual([3,4]); - }) + expect(List([1, 2, 3, 4, 5, 6]).slice(2).toArray()).toEqual([3, 4, 5, 6]); + expect(List([1, 2, 3, 4, 5, 6]).slice(2, 4).toArray()).toEqual([3, 4]); + }); it('returns self for whole slices', () => { - var s = Seq.of(1,2,3); + const s = Seq([1, 2, 3]); expect(s.slice(0)).toBe(s); expect(s.slice(0, 3)).toBe(s); expect(s.slice(-4, 4)).toBe(s); - var v = List.of(1,2,3); + const v = List([1, 2, 3]); expect(v.slice(-4, 4)).toBe(v); expect(v.slice(-3)).toBe(v); expect(v.slice(-4, 4).toList()).toBe(v); - }) + }); it('creates a sliced list in O(log32(n))', () => { - expect(List.of(1,2,3,4,5).slice(-3, -1).toList().toArray()).toEqual([3,4]); - }) + expect(List([1, 2, 3, 4, 5]).slice(-3, -1).toList().toArray()).toEqual([ + 3, 4, + ]); + }); it('has the same behavior as array slice in known edge cases', () => { - var a = I.Range(0, 33).toArray(); - var v = List(a); + const a = Range(0, 33).toArray(); + const v = List(a); expect(v.slice(31).toList().toArray()).toEqual(a.slice(31)); - }) + }); + + it('does not slice by floating-point numbers', () => { + const seq = Seq([0, 1, 2, 3, 4, 5]); + const sliced = seq.slice(0, 2.6); + expect(sliced.size).toEqual(2); + expect(sliced.toArray()).toEqual([0, 1]); + }); it('can create an iterator', () => { - var seq = Seq([0,1,2,3,4,5]); - var iterFront = seq.slice(0,2).values(); - expect(iterFront.next()).toEqual({value: 0, done: false}); - expect(iterFront.next()).toEqual({value: 1, done: false}); - expect(iterFront.next()).toEqual({value: undefined, done: true}); - - var iterMiddle = seq.slice(2,4).values(); - expect(iterMiddle.next()).toEqual({value: 2, done: false}); - expect(iterMiddle.next()).toEqual({value: 3, done: false}); - expect(iterMiddle.next()).toEqual({value: undefined, done: true}); - - var iterTail = seq.slice(4,123456).values(); - expect(iterTail.next()).toEqual({value: 4, done: false}); - expect(iterTail.next()).toEqual({value: 5, done: false}); - expect(iterTail.next()).toEqual({value: undefined, done: true}); - }) - - check.it('works like Array.prototype.slice', - [gen.int, gen.array(gen.oneOf([gen.int, gen.undefined]), 0, 3)], - (valuesLen, args) => { - var a = I.Range(0, valuesLen).toArray(); - var v = List(a); - var slicedV = v.slice.apply(v, args); - var slicedA = a.slice.apply(a, args); - expect(slicedV.toArray()).toEqual(slicedA); - }) - - check.it('works like Array.prototype.slice on sparse array input', - [gen.array(gen.array([gen.posInt, gen.int])), - gen.array(gen.oneOf([gen.int, gen.undefined]), 0, 3)], - (entries, args) => { - var a = []; - entries.forEach(entry => a[entry[0]] = entry[1]); - var s = Seq(a); - var slicedS = s.slice.apply(s, args); - var slicedA = a.slice.apply(a, args); - expect(slicedS.toArray()).toEqual(slicedA); - }) + const seq = Seq([0, 1, 2, 3, 4, 5]); + const iterFront = seq.slice(0, 2).values(); + expect(iterFront.next()).toEqual({ value: 0, done: false }); + expect(iterFront.next()).toEqual({ value: 1, done: false }); + expect(iterFront.next()).toEqual({ value: undefined, done: true }); - describe('take', () => { + const iterMiddle = seq.slice(2, 4).values(); + expect(iterMiddle.next()).toEqual({ value: 2, done: false }); + expect(iterMiddle.next()).toEqual({ value: 3, done: false }); + expect(iterMiddle.next()).toEqual({ value: undefined, done: true }); + + const iterTail = seq.slice(4, 123456).values(); + expect(iterTail.next()).toEqual({ value: 4, done: false }); + expect(iterTail.next()).toEqual({ value: 5, done: false }); + expect(iterTail.next()).toEqual({ value: undefined, done: true }); + }); + + it('stops the entries iterator when the sequence has an undefined end', () => { + let seq = Seq([0, 1, 2, 3, 4, 5]); + // flatMap is lazy and thus the resulting sequence has no size. + seq = seq.flatMap((a) => [a]); + expect(seq.size).toEqual(undefined); + + const iterFront = seq.slice(0, 2).entries(); + expect(iterFront.next()).toEqual({ value: [0, 0], done: false }); + expect(iterFront.next()).toEqual({ value: [1, 1], done: false }); + expect(iterFront.next()).toEqual({ value: undefined, done: true }); + + const iterMiddle = seq.slice(2, 4).entries(); + expect(iterMiddle.next()).toEqual({ value: [0, 2], done: false }); + expect(iterMiddle.next()).toEqual({ value: [1, 3], done: false }); + expect(iterMiddle.next()).toEqual({ value: undefined, done: true }); - check.it('takes the first n from a list', [gen.int, gen.posInt], (len, num) => { - var a = I.Range(0, len).toArray(); - var v = List(a); - expect(v.take(num).toArray()).toEqual(a.slice(0, num)); - }) + const iterTail = seq.slice(4, 123456).entries(); + expect(iterTail.next()).toEqual({ value: [0, 4], done: false }); + expect(iterTail.next()).toEqual({ value: [1, 5], done: false }); + expect(iterTail.next()).toEqual({ value: undefined, done: true }); + }); + + it('works like Array.prototype.slice', () => { + fc.assert( + fc.property( + fc.integer({ min: -1000, max: 1000 }), + fc.sparseArray(fc.integer({ min: -1000, max: 1000 }), { maxLength: 3 }), + (valuesLen, args) => { + const a = Range(0, valuesLen).toArray(); + const v = List(a); + const slicedV = v.slice.apply(v, args); + const slicedA = a.slice.apply(a, args); + expect(slicedV.toArray()).toEqual(slicedA); + } + ) + ); + }); + + it('works like Array.prototype.slice on sparse array input', () => { + fc.assert( + fc.property( + fc.array(fc.tuple(fc.nat(1000), fc.integer({ min: -1000, max: 1000 }))), + fc.sparseArray(fc.integer({ min: -1000, max: 1000 }), { maxLength: 3 }), + (entries, args) => { + const a: Array = []; + entries.forEach((entry) => (a[entry[0]] = entry[1])); + const s = Seq(a); + const slicedS = s.slice.apply(s, args); + const slicedA = a.slice.apply(a, args); + expect(slicedS.toArray()).toEqual(slicedA); + } + ) + ); + }); + + describe('take', () => { + it('takes the first n from a list', () => { + fc.assert( + fc.property( + fc.integer({ min: -1000, max: 1000 }), + fc.nat(1000), + (len, num) => { + const a = Range(0, len).toArray(); + const v = List(a); + expect(v.take(num).toArray()).toEqual(a.slice(0, num)); + } + ) + ); + }); it('creates an immutable stable sequence', () => { - var seq = Seq.of(1,2,3,4,5,6); - var sliced = seq.take(3); + const seq = Seq([1, 2, 3, 4, 5, 6]); + const sliced = seq.take(3); expect(sliced.toArray()).toEqual([1, 2, 3]); expect(sliced.toArray()).toEqual([1, 2, 3]); expect(sliced.toArray()).toEqual([1, 2, 3]); - }) - - }) + }); -}) + it('converts to array with correct length', () => { + const seq = Seq([1, 2, 3, 4, 5, 6]); + const s1 = seq.take(3); + const s2 = seq.take(10); + const sn = seq.take(Infinity); + const s3 = seq.filter((v) => v < 4).take(10); + const s4 = seq.filter((v) => v < 4).take(2); + expect(s1.toArray().length).toEqual(3); + expect(s2.toArray().length).toEqual(6); + expect(sn.toArray().length).toEqual(6); + expect(s3.toArray().length).toEqual(3); + expect(s4.toArray().length).toEqual(2); + }); + }); +}); diff --git a/__tests__/sort.ts b/__tests__/sort.ts index 66f822fcdb..0a5afbf9ad 100644 --- a/__tests__/sort.ts +++ b/__tests__/sort.ts @@ -1,46 +1,78 @@ -/// -/// - -jest.autoMockOff(); - -import I = require('immutable'); -import Seq = I.Seq; -import List = I.List; -import OrderedMap = I.OrderedMap; -import Range = I.Range; +import { describe, expect, it } from '@jest/globals'; +import { List, OrderedMap, Range, Seq } from 'immutable'; describe('sort', () => { - it('sorts a sequence', () => { - expect(Seq.of(4,5,6,3,2,1).sort().toArray()).toEqual([1,2,3,4,5,6]); - }) + expect(Seq([4, 5, 6, 3, 2, 1]).sort().toArray()).toEqual([ + 1, 2, 3, 4, 5, 6, + ]); + }); it('sorts a list', () => { - expect(List.of(4,5,6,3,2,1).sort().toArray()).toEqual([1,2,3,4,5,6]); - }) + expect(List([4, 5, 6, 3, 2, 1]).sort().toArray()).toEqual([ + 1, 2, 3, 4, 5, 6, + ]); + }); + + it('sorts undefined values last', () => { + expect( + List([4, undefined, 5, 6, 3, undefined, 2, 1]).sort().toArray() + ).toEqual([1, 2, 3, 4, 5, 6, undefined, undefined]); + }); it('sorts a keyed sequence', () => { - expect(Seq({z:1,y:2,x:3,c:3,b:2,a:1}).sort().entrySeq().toArray()) - .toEqual([['z', 1],['a', 1],['y', 2],['b', 2],['x', 3],['c', 3]]); - }) + expect( + Seq({ z: 1, y: 2, x: 3, c: 3, b: 2, a: 1 }).sort().entrySeq().toArray() + ).toEqual([ + ['z', 1], + ['a', 1], + ['y', 2], + ['b', 2], + ['x', 3], + ['c', 3], + ]); + }); it('sorts an OrderedMap', () => { - expect(OrderedMap({z:1,y:2,x:3,c:3,b:2,a:1}).sort().entrySeq().toArray()) - .toEqual([['z', 1],['a', 1],['y', 2],['b', 2],['x', 3],['c', 3]]); - }) + expect( + OrderedMap({ z: 1, y: 2, x: 3, c: 3, b: 2, a: 1 }) + .sort() + .entrySeq() + .toArray() + ).toEqual([ + ['z', 1], + ['a', 1], + ['y', 2], + ['b', 2], + ['x', 3], + ['c', 3], + ]); + }); it('accepts a sort function', () => { - expect(Seq.of(4,5,6,3,2,1).sort((a, b) => b - a).toArray()).toEqual([6,5,4,3,2,1]); - }) + expect( + Seq([4, 5, 6, 3, 2, 1]) + .sort((a, b) => b - a) + .toArray() + ).toEqual([6, 5, 4, 3, 2, 1]); + }); it('sorts by using a mapper', () => { - expect(Range(1,10).sortBy(v => v % 3).toArray()) - .toEqual([3,6,9,1,4,7,2,5,8]); - }) + expect( + Range(1, 10) + .sortBy((v) => v % 3) + .toArray() + ).toEqual([3, 6, 9, 1, 4, 7, 2, 5, 8]); + }); it('sorts by using a mapper and a sort function', () => { - expect(Range(1,10).sortBy(v => v % 3, (a: number, b: number) => b - a).toArray()) - .toEqual([2,5,8,1,4,7,3,6,9]); - }) - -}) + expect( + Range(1, 10) + .sortBy( + (v) => v % 3, + (a: number, b: number) => b - a + ) + .toArray() + ).toEqual([2, 5, 8, 1, 4, 7, 3, 6, 9]); + }); +}); diff --git a/__tests__/splice.ts b/__tests__/splice.ts index c80f0f81cf..cb90281016 100644 --- a/__tests__/splice.ts +++ b/__tests__/splice.ts @@ -1,47 +1,65 @@ -/// -/// - -jest.autoMockOff(); - -import jasmineCheck = require('jasmine-check'); -jasmineCheck.install(); - -import I = require('immutable'); -import Seq = I.Seq; -import List = I.List; +import { describe, expect, it } from '@jest/globals'; +import { List, Range, Seq } from 'immutable'; +import fc from 'fast-check'; describe('splice', () => { - it('splices a sequence only removing elements', () => { - expect(Seq.of(1,2,3).splice(0,1).toArray()).toEqual([2,3]); - expect(Seq.of(1,2,3).splice(1,1).toArray()).toEqual([1,3]); - expect(Seq.of(1,2,3).splice(2,1).toArray()).toEqual([1,2]); - expect(Seq.of(1,2,3).splice(3,1).toArray()).toEqual([1,2,3]); - }) + expect(Seq([1, 2, 3]).splice(0, 1).toArray()).toEqual([2, 3]); + expect(Seq([1, 2, 3]).splice(1, 1).toArray()).toEqual([1, 3]); + expect(Seq([1, 2, 3]).splice(2, 1).toArray()).toEqual([1, 2]); + expect(Seq([1, 2, 3]).splice(3, 1).toArray()).toEqual([1, 2, 3]); + }); it('splices a list only removing elements', () => { - expect(List.of(1,2,3).splice(0,1).toArray()).toEqual([2,3]); - expect(List.of(1,2,3).splice(1,1).toArray()).toEqual([1,3]); - expect(List.of(1,2,3).splice(2,1).toArray()).toEqual([1,2]); - expect(List.of(1,2,3).splice(3,1).toArray()).toEqual([1,2,3]); - }) + expect(List([1, 2, 3]).splice(0, 1).toArray()).toEqual([2, 3]); + expect(List([1, 2, 3]).splice(1, 1).toArray()).toEqual([1, 3]); + expect(List([1, 2, 3]).splice(2, 1).toArray()).toEqual([1, 2]); + expect(List([1, 2, 3]).splice(3, 1).toArray()).toEqual([1, 2, 3]); + }); + + it('splicing by infinity', () => { + const l = List(['a', 'b', 'c', 'd']); + expect(l.splice(2, Infinity, 'x').toArray()).toEqual(['a', 'b', 'x']); + expect(l.splice(Infinity, 2, 'x').toArray()).toEqual([ + 'a', + 'b', + 'c', + 'd', + 'x', + ]); + + const s = List(['a', 'b', 'c', 'd']); + expect(s.splice(2, Infinity, 'x').toArray()).toEqual(['a', 'b', 'x']); + expect(s.splice(Infinity, 2, 'x').toArray()).toEqual([ + 'a', + 'b', + 'c', + 'd', + 'x', + ]); + }); it('has the same behavior as array splice in known edge cases', () => { - // arbitary numbers that sum to 31 - var a = I.Range(0, 49).toArray(); - var v = List(a); + // arbitrary numbers that sum to 31 + const a = Range(0, 49).toArray(); + const v = List(a); a.splice(-18, 0, 0); expect(v.splice(-18, 0, 0).toList().toArray()).toEqual(a); - }) - - check.it('has the same behavior as array splice', - [gen.array(gen.int), gen.array(gen.oneOf([gen.int, gen.undefined]))], - (values, args) => { - var v = List(values); - var a = values.slice(); // clone - var splicedV = v.splice.apply(v, args); // persistent - a.splice.apply(a, args); // mutative - expect(splicedV.toArray()).toEqual(a); - }) + }); -}) + it('has the same behavior as array splice', () => { + fc.assert( + fc.property( + fc.array(fc.integer()), + fc.array(fc.sparseArray(fc.integer())), + (values, args) => { + const v = List(values); + const a = values.slice(); // clone + const splicedV = v.splice.apply(v, args); // persistent + a.splice.apply(a, args); // mutative + expect(splicedV.toArray()).toEqual(a); + } + ) + ); + }); +}); diff --git a/__tests__/transformerProtocol.ts b/__tests__/transformerProtocol.ts new file mode 100644 index 0000000000..c3cedb3577 --- /dev/null +++ b/__tests__/transformerProtocol.ts @@ -0,0 +1,101 @@ +import { describe, expect, it } from '@jest/globals'; +import * as t from 'transducers-js'; +import { List, Map, Set, Stack } from 'immutable'; + +describe('Transformer Protocol', () => { + it('transduces Stack without initial values', () => { + const s = Stack.of(1, 2, 3, 4); + const xform = t.comp( + t.filter((x) => x % 2 === 0), + t.map((x) => x + 1) + ); + const s2 = t.transduce(xform, Stack(), s); + expect(s.toArray()).toEqual([1, 2, 3, 4]); + expect(s2.toArray()).toEqual([5, 3]); + }); + + it('transduces Stack with initial values', () => { + const v1 = Stack.of(1, 2, 3); + const v2 = Stack.of(4, 5, 6, 7); + const xform = t.comp( + t.filter((x) => x % 2 === 0), + t.map((x) => x + 1) + ); + const r = t.transduce(xform, Stack(), v1, v2); + expect(v1.toArray()).toEqual([1, 2, 3]); + expect(v2.toArray()).toEqual([4, 5, 6, 7]); + expect(r.toArray()).toEqual([7, 5, 1, 2, 3]); + }); + + it('transduces List without initial values', () => { + const v = List.of(1, 2, 3, 4); + const xform = t.comp( + t.filter((x) => x % 2 === 0), + t.map((x) => x + 1) + ); + const r = t.transduce(xform, List(), v); + expect(v.toArray()).toEqual([1, 2, 3, 4]); + expect(r.toArray()).toEqual([3, 5]); + }); + + it('transduces List with initial values', () => { + const v1 = List.of(1, 2, 3); + const v2 = List.of(4, 5, 6, 7); + const xform = t.comp( + t.filter((x) => x % 2 === 0), + t.map((x) => x + 1) + ); + const r = t.transduce(xform, List(), v1, v2); + expect(v1.toArray()).toEqual([1, 2, 3]); + expect(v2.toArray()).toEqual([4, 5, 6, 7]); + expect(r.toArray()).toEqual([1, 2, 3, 5, 7]); + }); + + it('transduces Map without initial values', () => { + const m1 = Map({ a: 1, b: 2, c: 3, d: 4 }); + const xform = t.comp( + t.filter(([_k, v]) => v % 2 === 0), + t.map(([k, v]) => [k, v * 2]) + ); + const m2 = t.transduce(xform, Map(), m1); + expect(m1.toObject()).toEqual({ a: 1, b: 2, c: 3, d: 4 }); + expect(m2.toObject()).toEqual({ b: 4, d: 8 }); + }); + + it('transduces Map with initial values', () => { + const m1 = Map({ a: 1, b: 2, c: 3 }); + const m2 = Map({ a: 4, b: 5 }); + const xform = t.comp( + t.filter(([_k, v]) => v % 2 === 0), + t.map(([k, v]) => [k, v * 2]) + ); + const m3 = t.transduce(xform, Map(), m1, m2); + expect(m1.toObject()).toEqual({ a: 1, b: 2, c: 3 }); + expect(m2.toObject()).toEqual({ a: 4, b: 5 }); + expect(m3.toObject()).toEqual({ a: 8, b: 2, c: 3 }); + }); + + it('transduces Set without initial values', () => { + const s1 = Set.of(1, 2, 3, 4); + const xform = t.comp( + t.filter((x) => x % 2 === 0), + t.map((x) => x + 1) + ); + const s2 = t.transduce(xform, Set(), s1); + expect(s1.toArray()).toEqual([1, 2, 3, 4]); + expect(s2.toArray()).toEqual([3, 5]); + }); + + it('transduces Set with initial values', () => { + const s1 = Set.of(1, 2, 3, 4); + const s2 = Set.of(2, 3, 4, 5, 6); + const xform = t.comp( + t.filter((x) => x % 2 === 0), + t.map((x) => x + 1) + ); + const s3 = t.transduce(xform, Set(), s1, s2); + expect(s1.toArray()).toEqual([1, 2, 3, 4]); + expect(s2.toArray()).toEqual([2, 3, 4, 5, 6]); + expect(s3.toArray()).toEqual([1, 2, 3, 4, 5, 7]); + }); +}); diff --git a/__tests__/ts-utils.ts b/__tests__/ts-utils.ts new file mode 100644 index 0000000000..d4cc759e68 --- /dev/null +++ b/__tests__/ts-utils.ts @@ -0,0 +1,7 @@ +import { expect } from '@jest/globals'; + +export function expectToBeDefined( + arg: T +): asserts arg is Exclude { + expect(arg).toBeDefined(); +} diff --git a/__tests__/tsconfig.json b/__tests__/tsconfig.json new file mode 100644 index 0000000000..78742cd9bd --- /dev/null +++ b/__tests__/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "noEmit": true, + // TODO: add additional strictness + "strictNullChecks": true, + "strictFunctionTypes": true, + "target": "esnext", + "moduleResolution": "node", + "skipLibCheck": true, + "paths": { + "immutable": ["../type-definitions/immutable.d.ts"] + } + } +} diff --git a/__tests__/updateIn.ts b/__tests__/updateIn.ts index b83b5c5a8b..1ca054f979 100644 --- a/__tests__/updateIn.ts +++ b/__tests__/updateIn.ts @@ -1,274 +1,457 @@ -/// -/// +import { describe, expect, it } from '@jest/globals'; +import { + fromJS, + List, + Map, + MapOf, + removeIn, + Seq, + Set, + setIn, + updateIn, +} from 'immutable'; -jest.autoMockOff(); +describe('updateIn', () => { + it('deep edit', () => { + const m = fromJS({ a: { b: { c: 10 } } }); + expect( + // @ts-expect-error -- type of fromJS may return a MapOf in the future, to help `updateIn` to work, `updateIn` should copy the comportment of `getIn` + m.updateIn(['a', 'b', 'c'], (value: number) => value * 2).toJS() + ).toEqual({ + a: { b: { c: 20 } }, + }); + }); -import I = require('immutable'); + it('deep edit with list as keyPath', () => { + const m = fromJS({ a: { b: { c: 10 } } }); + expect( + // @ts-expect-error -- type of fromJS may return a MapOf in the future, to help `updateIn` to work, `updateIn` should copy the comportment of `getIn` + m.updateIn(fromJS(['a', 'b', 'c']), (value: number) => value * 2).toJS() + ).toEqual({ a: { b: { c: 20 } } }); + }); -describe('updateIn', () => { + it('deep edit in raw JS', () => { + const m = { a: { b: { c: [10] } } }; + expect( + updateIn(m, ['a', 'b', 'c', 0], (value: number) => value * 2) + ).toEqual({ + a: { b: { c: [20] } }, + }); + }); - it('deep get', () => { - var m = I.fromJS({a: {b: {c: 10}}}); - expect(m.getIn(['a', 'b', 'c'])).toEqual(10); - }) + it('deep edit throws without list or array-like', () => { + // @ts-expect-error -- test that runtime does throw + expect(() => Map().updateIn(undefined, (x) => x)).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: undefined' + ); + // @ts-expect-error -- test that runtime does th + expect(() => Map().updateIn({ a: 1, b: 2 }, (x) => x)).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: [object Object]' + ); + expect(() => Map().updateIn('abc', (x) => x)).toThrow( + 'Invalid keyPath: expected Ordered Collection or Array: abc' + ); + }); - it('deep get with list as keyPath', () => { - var m = I.fromJS({a: {b: {c: 10}}}); - expect(m.getIn(I.fromJS(['a', 'b', 'c']))).toEqual(10); - }) + it('deep edit throws if non-editable path', () => { + const deep = Map({ key: Set([List(['item'])]) }); + expect(() => deep.updateIn(['key', 'foo', 'item'], () => 'newval')).toThrow( + 'Cannot update immutable value without .set() method: Set { List [ "item" ] }' + ); - it('deep get throws without list or array-like', () => { - // need to cast these as TypeScript first prevents us from such clownery. - expect(() => - I.Map().getIn(undefined) - ).toThrow('Expected iterable or array-like: undefined'); + const deepSeq = Map({ key: Seq([List(['item'])]) }); expect(() => - I.Map().getIn({ a: 1, b: 2 }) - ).toThrow('Expected iterable or array-like: [object Object]'); - }) + deepSeq.updateIn(['key', 'foo', 'item'], () => 'newval') + ).toThrow( + 'Cannot update immutable value without .set() method: Seq [ List [ "item" ] ]' + ); - it('deep has throws without list or array-like', () => { - // need to cast these as TypeScript first prevents us from such clownery. - expect(() => - I.Map().hasIn(undefined) - ).toThrow('Expected iterable or array-like: undefined'); - expect(() => - I.Map().hasIn({ a: 1, b: 2 }) - ).toThrow('Expected iterable or array-like: [object Object]'); - }) + const nonObj = Map({ key: 123 }); + expect(() => nonObj.updateIn(['key', 'foo'], () => 'newval')).toThrow( + 'Cannot update within non-data-structure value in path ["key"]: 123' + ); + }); - it('deep get returns not found if path does not match', () => { - var m = I.fromJS({a: {b: {c: 10}}}); - expect(m.getIn(['a', 'b', 'z'])).toEqual(undefined); - expect(m.getIn(['a', 'b', 'c', 'd'])).toEqual(undefined); - }) + it('handle ArrayLike objects that are nor Array not immutable Collection', () => { + class CustomArrayLike implements ArrayLike { + readonly length: number; + [n: number]: T; - it('deep edit', () => { - var m = I.fromJS({a: {b: {c: 10}}}); - expect( - m.updateIn(['a', 'b', 'c'], value => value * 2).toJS() - ).toEqual( - {a: {b: {c: 20}}} - ); - }) + constructor(...values: Array) { + this.length = values.length; - it('deep edit with list as keyPath', () => { - var m = I.fromJS({a: {b: {c: 10}}}); + for (let i = 0; i < values.length; i++) { + this[i] = values[i]; + } + } + + // Define other methods if needed, but do not include the `slice` method + // For example, you can define a method to set values + set(index: number, value: T): void { + if (index < 0 || index >= this.length) { + throw new RangeError('Index out of bounds'); + } + + this[index] = value; + } + + // Define a method to get values + get(index: number): T { + if (index < 0 || index >= this.length) { + throw new RangeError('Index out of bounds'); + } + + return this[index]; + } + } + + // create an ArrayLike + const customArray = new CustomArrayLike(10, 20); + + // code that works perfectly expect( - m.updateIn(I.fromJS(['a', 'b', 'c']), value => value * 2).toJS() - ).toEqual( - {a: {b: {c: 20}}} - ); - }) + updateIn({ 10: { 20: 'a' } }, customArray, (v) => + // @ts-expect-error -- `updateIn` keypath type should be `OrderedCollection | ArrayLike; + typeof v === 'string' ? v.toUpperCase() : v + ) + ).toEqual({ 10: { 20: 'A' } }); - it('deep edit throws without list or array-like', () => { - // need to cast these as TypeScript first prevents us from such clownery. - expect(() => - I.Map().updateIn(undefined, x => x) - ).toThrow('Expected iterable or array-like: undefined'); expect(() => - I.Map().updateIn({ a: 1, b: 2 }, x => x) - ).toThrow('Expected iterable or array-like: [object Object]'); - }) + updateIn({ 10: 'a' }, customArray, (v) => + // @ts-expect-error -- `updateIn` keypath type should be `OrderedCollection | ArrayLike; + typeof v === 'string' ? v.toUpperCase() : v + ) + ).toThrow('Cannot update within non-data-structure value in path [10]: a'); + }); + + it('identity with notSetValue is still identity', () => { + const m = Map({ a: { b: { c: 10 } } }); + expect(m.updateIn(['x'], 100, (id) => id)).toEqual(m); + }); + it('shallow remove', () => { + const m = Map({ a: 123 }); + expect(m.updateIn([], () => undefined)).toEqual(undefined); + }); it('deep remove', () => { - var m = I.fromJS({a: {b: {c: 10}}}); + const m = fromJS({ a: { b: { c: 10 } } }); expect( - m.updateIn(['a', 'b'], map => map.remove('c')).toJS() - ).toEqual( - {a: {b: {}}} - ); - }) + m + // @ts-expect-error -- type of fromJS may return a MapOf in the future, to help `updateIn` to work, `updateIn` should copy the comportment of `getIn` + .updateIn(['a', 'b'], (map: MapOf<{ c: number }>) => map.remove('c')) + .toJS() + ).toEqual({ + a: { b: {} }, + }); + }); it('deep set', () => { - var m = I.fromJS({a: {b: {c: 10}}}); + const m = fromJS({ a: { b: { c: 10 } } }); expect( - m.updateIn(['a', 'b'], map => map.set('d', 20)).toJS() - ).toEqual( - {a: {b: {c: 10, d: 20}}} - ); - }) + m + // @ts-expect-error -- type of fromJS may return a MapOf in the future, to help `updateIn` to work, `updateIn` should copy the comportment of `getIn` + .updateIn(['a', 'b'], (map: MapOf<{ c: number }>) => map.set('d', 20)) + .toJS() + ).toEqual({ + a: { b: { c: 10, d: 20 } }, + }); + }); it('deep push', () => { - var m = I.fromJS({a: {b: [1,2,3]}}); + const m = fromJS({ a: { b: [1, 2, 3] } }); expect( - m.updateIn(['a', 'b'], list => list.push(4)).toJS() - ).toEqual( - {a: {b: [1,2,3,4]}} - ); - }) + // @ts-expect-error -- type of fromJS may return a MapOf in the future, to help `updateIn` to work, `updateIn` should copy the comportment of `getIn` + m.updateIn(['a', 'b'], (list: List) => list.push(4)).toJS() + ).toEqual({ + a: { b: [1, 2, 3, 4] }, + }); + }); it('deep map', () => { - var m = I.fromJS({a: {b: [1,2,3]}}); + const m = fromJS({ a: { b: [1, 2, 3] } }); expect( - m.updateIn(['a', 'b'], list => list.map(value => value * 10)).toJS() - ).toEqual( - {a: {b: [10, 20, 30]}} - ); - }) + m + // @ts-expect-error -- type of fromJS may return a MapOf in the future, to help `updateIn` to work, `updateIn` should copy the comportment of `getIn` + .updateIn(['a', 'b'], (list: List) => + list.map((value) => value * 10) + ) + .toJS() + ).toEqual({ a: { b: [10, 20, 30] } }); + }); it('creates new maps if path contains gaps', () => { - var m = I.fromJS({a: {b: {c: 10}}}); + const m = fromJS({ a: { b: { c: 10 } } }); expect( - m.updateIn(['a', 'z'], I.Map(), map => map.set('d', 20)).toJS() - ).toEqual( - {a: {b: {c: 10}, z: {d: 20}}} - ); - }) + m + .updateIn( + ['a', 'q', 'z'], + Map(), + // @ts-expect-error -- updateIn should handle the `notSetValue` parameter + (map: Map) => map.set('d', 20) + ) + .toJS() + ).toEqual({ a: { b: { c: 10 }, q: { z: { d: 20 } } } }); + }); + + it('creates new objects if path contains gaps within raw JS', () => { + const m = { a: { b: { c: 10 } } }; + expect( + updateIn( + m, + ['a', 'b', 'z'], + Map(), + (map: Map) => map.set('d', 20) + ) + ).toEqual({ a: { b: { c: 10, z: Map({ d: 20 }) } } }); + }); it('throws if path cannot be set', () => { - var m = I.fromJS({a: {b: {c: 10}}}); + const m = fromJS({ a: { b: { c: 10 } } }); expect(() => { - m.updateIn(['a', 'b', 'c', 'd'], v => 20).toJS() - }).toThrow(); - }) + m.updateIn(['a', 'b', 'c', 'd'], () => 20).toJS(); + }).toThrow( + 'Cannot update within non-data-structure value in path ["a","b","c"]: 10' + ); + }); + + it('update with notSetValue when non-existing key', () => { + const m = Map({ a: { b: { c: 10 } } }); + // @ts-expect-error -- updateIn should handle the `notSetValue` parameter + expect(m.updateIn(['x'], 100, (map: number) => map + 1).toJS()).toEqual({ + a: { b: { c: 10 } }, + x: 101, + }); + }); + + it('update with notSetValue when non-existing key in raw JS', () => { + const m = { a: { b: { c: 10 } } }; + expect(updateIn(m, ['x'], 100, (map: number) => map + 1)).toEqual({ + a: { b: { c: 10 } }, + x: 101, + }); + }); it('updates self for empty path', () => { - var m = I.fromJS({a: 1, b: 2, c: 3}); - expect( - m.updateIn([], map => map.set('b', 20)).toJS() - ).toEqual( - {a: 1, b: 20, c: 3} - ) - }) + const m = fromJS({ a: 1, b: 2, c: 3 }); + // @ts-expect-error -- type of fromJS may return a MapOf in the future, to help `updateIn` to work, `updateIn` should copy the comportment of `getIn` + expect(m.updateIn([], (map: typeof m) => map.set('b', 20)).toJS()).toEqual({ + a: 1, + b: 20, + c: 3, + }); + }); it('does not perform edit when new value is the same as old value', () => { - var m = I.fromJS({a: {b: {c: 10}}}); - var m2 = m.updateIn(['a', 'b', 'c'], id => id); + const m = fromJS({ a: { b: { c: 10 } } }); + const m2 = m.updateIn(['a', 'b', 'c'], (id) => id); expect(m2).toBe(m); - }) + }); + + it('does not perform edit when new value is the same as old value in raw JS', () => { + const m = { a: { b: { c: 10 } } }; + const m2 = updateIn(m, ['a', 'b', 'c'], (id) => id); + expect(m2).toBe(m); + }); it('does not perform edit when notSetValue is what you return from updater', () => { - var m = I.Map(); - var spiedOnID; - var m2 = m.updateIn(['a', 'b', 'c'], I.Set(), id => (spiedOnID = id)); + const m = Map(); + let spiedOnID; + const m2 = m.updateIn(['a', 'b', 'c'], Set(), (id) => (spiedOnID = id)); expect(m2).toBe(m); - expect(spiedOnID).toBe(I.Set()); - }) + expect(spiedOnID).toBe(Set()); + }); it('provides default notSetValue of undefined', () => { - var m = I.Map(); - var spiedOnID; - var m2 = m.updateIn(['a', 'b', 'c'], id => (spiedOnID = id)); + const m = Map(); + let spiedOnID; + const m2 = m.updateIn(['a', 'b', 'c'], (id) => (spiedOnID = id)); expect(m2).toBe(m); expect(spiedOnID).toBe(undefined); - }) + }); describe('setIn', () => { - it('provides shorthand for updateIn to set a single value', () => { - var m = I.Map().setIn(['a','b','c'], 'X'); - expect(m.toJS()).toEqual({a:{b:{c:'X'}}}); - }) + const m = Map().setIn(['a', 'b', 'c'], 'X'); + expect(m).toEqual(fromJS({ a: { b: { c: 'X' } } })); + }); it('accepts a list as a keyPath', () => { - var m = I.Map().setIn(I.fromJS(['a','b','c']), 'X'); - expect(m.toJS()).toEqual({a:{b:{c:'X'}}}); - }) + const m = Map().setIn(fromJS(['a', 'b', 'c']), 'X'); + expect(m).toEqual(fromJS({ a: { b: { c: 'X' } } })); + }); it('returns value when setting empty path', () => { - var m = I.Map(); - expect(m.setIn([], 'X')).toBe('X') - }) + const m = Map(); + expect(m.setIn([], 'X')).toBe('X'); + }); it('can setIn undefined', () => { - var m = I.Map().setIn(['a','b','c'], undefined); - expect(m.toJS()).toEqual({a:{b:{c:undefined}}}); + const m = Map().setIn(['a', 'b', 'c'], undefined); + expect(m).toEqual(Map({ a: Map({ b: Map({ c: undefined }) }) })); }); - }) + it('returns self for a no-op', () => { + const m = fromJS({ a: { b: { c: 123 } } }); + expect(m.setIn(['a', 'b', 'c'], 123)).toBe(m); + }); - describe('removeIn', () => { + it('provides shorthand for updateIn to set a single value in raw JS', () => { + const m = setIn({}, ['a', 'b', 'c'], 'X'); + expect(m).toEqual({ a: { b: { c: 'X' } } }); + }); + + it('accepts a list as a keyPath in raw JS', () => { + const m = setIn({}, fromJS(['a', 'b', 'c']), 'X'); + expect(m).toEqual({ a: { b: { c: 'X' } } }); + }); + + it('returns value when setting empty path in raw JS', () => { + expect(setIn({}, [], 'X')).toBe('X'); + }); + it('can setIn undefined in raw JS', () => { + const m = setIn({}, ['a', 'b', 'c'], undefined); + expect(m).toEqual({ a: { b: { c: undefined } } }); + }); + + it('returns self for a no-op in raw JS', () => { + const m = { a: { b: { c: 123 } } }; + expect(setIn(m, ['a', 'b', 'c'], 123)).toBe(m); + }); + }); + + describe('removeIn', () => { it('provides shorthand for updateIn to remove a single value', () => { - var m = I.fromJS({a:{b:{c:'X', d:'Y'}}}); - expect(m.removeIn(['a','b','c']).toJS()).toEqual({a:{b:{d:'Y'}}}); - }) + const m = fromJS({ a: { b: { c: 'X', d: 'Y' } } }) as Map< + string, + unknown + >; + expect(m.removeIn(['a', 'b', 'c']).toJS()).toEqual({ + a: { b: { d: 'Y' } }, + }); + }); it('accepts a list as a keyPath', () => { - var m = I.fromJS({a:{b:{c:'X', d:'Y'}}}); - expect(m.removeIn(I.fromJS(['a','b','c'])).toJS()).toEqual({a:{b:{d:'Y'}}}); - }) + const m = fromJS({ a: { b: { c: 'X', d: 'Y' } } }) as Map< + string, + unknown + >; + expect(m.removeIn(fromJS(['a', 'b', 'c'])).toJS()).toEqual({ + a: { b: { d: 'Y' } }, + }); + }); it('does not create empty maps for an unset path', () => { - var m = I.Map(); - expect(m.removeIn(['a','b','c']).toJS()).toEqual({}); - }) + const m = Map(); + expect(m.removeIn(['a', 'b', 'c']).toJS()).toEqual({}); + }); it('removes itself when removing empty path', () => { - var m = I.Map(); - expect(m.removeIn([])).toBe(undefined) - }) + const m = Map(); + expect(m.removeIn([])).toBe(undefined); + }); - }) + it('removes values from a Set', () => { + const m = Map({ set: Set([1, 2, 3]) }); + const m2 = m.removeIn(['set', 2]); + expect(m2.toJS()).toEqual({ set: [1, 3] }); + }); - describe('mergeIn', () => { + it('returns undefined when removing an empty path in raw JS', () => { + expect(removeIn({}, [])).toBe(undefined); + }); + it('can removeIn in raw JS', () => { + const m = removeIn({ a: { b: { c: 123 } } }, ['a', 'b', 'c']); + expect(m).toEqual({ a: { b: { c: undefined } } }); + }); + + it('returns self for a no-op in raw JS', () => { + const m = { a: { b: { c: 123 } } }; + expect(removeIn(m, ['a', 'b', 'd'])).toBe(m); + }); + }); + + describe('mergeIn', () => { it('provides shorthand for updateIn to merge a nested value', () => { - var m1 = I.fromJS({x:{a:1,b:2,c:3}}); - var m2 = I.fromJS({d:10,b:20,e:30}); - expect(m1.mergeIn(['x'], m2).toJS()).toEqual( - {x: {a:1,b:20,c:3,d:10,e:30}} - ); - }) + const m1 = fromJS({ x: { a: 1, b: 2, c: 3 } }); + const m2 = fromJS({ d: 10, b: 20, e: 30 }); + expect(m1.mergeIn(['x'], m2).toJS()).toEqual({ + x: { a: 1, b: 20, c: 3, d: 10, e: 30 }, + }); + }); it('accepts a list as a keyPath', () => { - var m1 = I.fromJS({x:{a:1,b:2,c:3}}); - var m2 = I.fromJS({d:10,b:20,e:30}); - expect(m1.mergeIn(I.fromJS(['x']), m2).toJS()).toEqual( - {x: {a:1,b:20,c:3,d:10,e:30}} - ); - }) + const m1 = fromJS({ x: { a: 1, b: 2, c: 3 } }); + const m2 = fromJS({ d: 10, b: 20, e: 30 }); + expect(m1.mergeIn(fromJS(['x']), m2).toJS()).toEqual({ + x: { a: 1, b: 20, c: 3, d: 10, e: 30 }, + }); + }); it('does not create empty maps for a no-op merge', () => { - var m = I.Map(); - expect(m.mergeIn(['a','b','c'], I.Map()).toJS()).toEqual({}); - }) + const m = Map(); + expect(m.mergeIn(['a', 'b', 'c'], Map()).toJS()).toEqual({}); + }); it('merges into itself for empty path', () => { - var m = I.Map({a:1,b:2,c:3}); - expect( - m.mergeIn([], I.Map({d:10,b:20,e:30})).toJS() - ).toEqual( - {a:1,b:20,c:3,d:10,e:30} - ) - }) + const m = Map({ a: 1, b: 2, c: 3 }); + expect(m.mergeIn([], Map({ d: 10, b: 20, e: 30 })).toJS()).toEqual({ + a: 1, + b: 20, + c: 3, + d: 10, + e: 30, + }); + }); - }) + it('merges into plain JS Object and Array', () => { + const m = Map({ a: { x: [1, 2, 3] } }); + expect(m.mergeIn(['a', 'x'], [4, 5, 6])).toEqual( + Map({ a: { x: [1, 2, 3, 4, 5, 6] } }) + ); + }); + }); describe('mergeDeepIn', () => { - it('provides shorthand for updateIn to merge a nested value', () => { - var m1 = I.fromJS({x:{a:1,b:2,c:3}}); - var m2 = I.fromJS({d:10,b:20,e:30}); - expect(m1.mergeDeepIn(['x'], m2).toJS()).toEqual( - {x: {a:1,b:20,c:3,d:10,e:30}} - ); - }) + const m1 = fromJS({ x: { a: 1, b: 2, c: 3 } }); + const m2 = fromJS({ d: 10, b: 20, e: 30 }); + expect(m1.mergeDeepIn(['x'], m2).toJS()).toEqual({ + x: { a: 1, b: 20, c: 3, d: 10, e: 30 }, + }); + }); it('accepts a list as a keyPath', () => { - var m1 = I.fromJS({x:{a:1,b:2,c:3}}); - var m2 = I.fromJS({d:10,b:20,e:30}); - expect(m1.mergeDeepIn(I.fromJS(['x']), m2).toJS()).toEqual( - {x: {a:1,b:20,c:3,d:10,e:30}} - ); - }) + const m1 = fromJS({ x: { a: 1, b: 2, c: 3 } }); + const m2 = fromJS({ d: 10, b: 20, e: 30 }); + expect(m1.mergeDeepIn(fromJS(['x']), m2).toJS()).toEqual({ + x: { a: 1, b: 20, c: 3, d: 10, e: 30 }, + }); + }); it('does not create empty maps for a no-op merge', () => { - var m = I.Map(); - expect(m.mergeDeepIn(['a','b','c'], I.Map()).toJS()).toEqual({}); - }) + const m = Map(); + expect(m.mergeDeepIn(['a', 'b', 'c'], Map()).toJS()).toEqual({}); + }); it('merges into itself for empty path', () => { - var m = I.Map({a:1,b:2,c:3}); - expect( - m.mergeDeepIn([], I.Map({d:10,b:20,e:30})).toJS() - ).toEqual( - {a:1,b:20,c:3,d:10,e:30} - ) - }) - - }) + const m = Map({ a: 1, b: 2, c: 3 }); + expect(m.mergeDeepIn([], Map({ d: 10, b: 20, e: 30 })).toJS()).toEqual({ + a: 1, + b: 20, + c: 3, + d: 10, + e: 30, + }); + }); -}) + it('merges deep into plain JS Object and Array', () => { + const m = Map({ a: { x: [1, 2, 3] } }); + expect(m.mergeDeepIn(['a'], { x: [4, 5, 6] })).toEqual( + Map({ a: { x: [1, 2, 3, 4, 5, 6] } }) + ); + }); + }); +}); diff --git a/__tests__/utils.js b/__tests__/utils.js new file mode 100644 index 0000000000..1d1c6b0e44 --- /dev/null +++ b/__tests__/utils.js @@ -0,0 +1,62 @@ +/** + * @jest-environment jsdom + */ + +import { List, isPlainObject } from 'immutable'; + +describe('Utils', () => { + describe('isPlainObj()', function testFunc() { + const nonPlainCases = [ + ['Host object', document.createElement('div')], + ['bool primitive false', false], + ['bool primitive true', true], + ['falsy undefined', undefined], + ['falsy null', null], + ['Simple function', function () {}], + [ + 'Instance of other object', + (function () { + function Foo() {} + return new Foo(); + })(), + ], + ['Number primitive ', 5], + ['String primitive ', 'P'], + ['Number Object', Number(6)], + ['Immutable.List', new List()], + ['simple array', ['one']], + ['Error', Error], + ['Internal namespaces', Math], + ['Arguments', arguments], + ]; + const plainCases = [ + ['literal Object', {}], + // eslint-disable-next-line no-object-constructor + ['new Object', new Object()], + ['Object.create(null)', Object.create(null)], + ['nested object', { one: { prop: 'two' } }], + ['constructor prop', { constructor: 'prop' }], // shadows an object's constructor + ['constructor.name', { constructor: { name: 'two' } }], // shadows an object's constructor.name + [ + 'Fake toString', + { + toString: function () { + return '[object Object]'; + }, + }, + ], + ]; + + nonPlainCases.forEach(([name, value]) => { + it(`${name} returns false`, () => { + expect(isPlainObject(value)).toBe(false); + }); + }); + + plainCases.forEach(([name, value]) => { + it(`${name} returns true`, () => { + expect(isPlainObject(value)).toBe(true); + }); + }); + }); +}); diff --git a/__tests__/zip.ts b/__tests__/zip.ts index 91d85b3666..4487fa1b95 100644 --- a/__tests__/zip.ts +++ b/__tests__/zip.ts @@ -1,107 +1,147 @@ -/// -/// - -jest.autoMockOff(); - -import I = require('immutable'); - -import jasmineCheck = require('jasmine-check'); -jasmineCheck.install(); +import { describe, expect, it } from '@jest/globals'; +import { List, Range, Seq } from 'immutable'; +import fc from 'fast-check'; +import { expectToBeDefined } from './ts-utils'; describe('zip', () => { - it('zips lists into a list of tuples', () => { expect( - I.Seq.of(1,2,3).zip(I.Seq.of(4,5,6)).toArray() - ).toEqual( - [[1,4],[2,5],[3,6]] + Seq([1, 2, 3]) + .zip(Seq([4, 5, 6])) + .toArray() + ).toEqual([ + [1, 4], + [2, 5], + [3, 6], + ]); + }); + + it('zip results can be converted to JS', () => { + const l1 = List([List([1]), List([2]), List([3])]); + const l2 = List([List([4]), List([5]), List([6])]); + const zipped = l1.zip(l2); + expect(zipped).toEqual( + List([ + [List([1]), List([4])], + [List([2]), List([5])], + [List([3]), List([6])], + ]) ); + expect(zipped.toJS()).toEqual([ + [[1], [4]], + [[2], [5]], + [[3], [6]], + ]); }); it('zips with infinite lists', () => { expect( - I.Range().zip(I.Seq.of('A','B','C')).toArray() - ).toEqual( - [[0,'A'],[1,'B'],[2,'C']] - ); + Range(0, Infinity) + .zip(Seq(['A', 'B', 'C'])) + .toArray() + ).toEqual([ + [0, 'A'], + [1, 'B'], + [2, 'C'], + ]); }); it('has unknown size when zipped with unknown size', () => { - var seq = I.Range(0, 10); - var zipped = seq.zip(seq.filter(n => n % 2 === 0)); + const seq = Range(0, 10); + const zipped = seq.zip(seq.filter((n) => n % 2 === 0)); expect(zipped.size).toBe(undefined); expect(zipped.count()).toBe(5); - }) + }); - check.it('is always the size of the smaller sequence', - [gen.notEmpty(gen.array(gen.posInt))], (lengths) => { - var ranges = lengths.map(l => I.Range(0, l)); - var first = ranges.shift(); - var zipped = first.zip.apply(first, ranges); - var shortestLength = Math.min.apply(Math, lengths); - expect(zipped.size).toBe(shortestLength); + it('is always the size of the smaller sequence', () => { + fc.assert( + fc.property(fc.array(fc.nat(), { minLength: 1 }), (lengths) => { + const ranges = lengths.map((l) => Range(0, l)); + const first = ranges.shift(); + expectToBeDefined(first); + const zipped = first.zip.apply(first, ranges); + const shortestLength = Math.min.apply(Math, lengths); + expect(zipped.size).toBe(shortestLength); + }) + ); }); describe('zipWith', () => { - it('zips with a custom function', () => { expect( - I.Seq.of(1,2,3).zipWith( - (a, b) => a + b, - I.Seq.of(4,5,6) - ).toArray() - ).toEqual( - [5,7,9] - ); + Seq([1, 2, 3]) + .zipWith((a, b) => a + b, Seq([4, 5, 6])) + .toArray() + ).toEqual([5, 7, 9]); }); it('can zip to create immutable collections', () => { expect( - I.Seq.of(1,2,3).zipWith( - () => I.List(arguments), - I.Seq.of(4,5,6), - I.Seq.of(7,8,9) - ).toJS() - ).toEqual( - [[1,4,7],[2,5,8],[3,6,9]] - ); + Seq([1, 2, 3]) + .zipWith( + function () { + // eslint-disable-next-line prefer-rest-params + return List(arguments); + }, + Seq([4, 5, 6]), + Seq([7, 8, 9]) + ) + .toJS() + ).toEqual([ + [1, 4, 7], + [2, 5, 8], + [3, 6, 9], + ]); }); + }); + describe('zipAll', () => { + it('fills in the empty zipped values with undefined', () => { + expect( + Seq([1, 2, 3]) + .zipAll(Seq([4])) + .toArray() + ).toEqual([ + [1, 4], + [2, undefined], + [3, undefined], + ]); + }); + + it('is always the size of the longest sequence', () => { + fc.assert( + fc.property(fc.array(fc.nat(), { minLength: 1 }), (lengths) => { + const ranges = lengths.map((l) => Range(0, l)); + const first = ranges.shift(); + expectToBeDefined(first); + const zipped = first.zipAll.apply(first, ranges); + const longestLength = Math.max.apply(Math, lengths); + expect(zipped.size).toBe(longestLength); + }) + ); + }); }); describe('interleave', () => { - it('interleaves multiple collections', () => { expect( - I.Seq.of(1,2,3).interleave( - I.Seq.of(4,5,6), - I.Seq.of(7,8,9) - ).toArray() - ).toEqual( - [1,4,7,2,5,8,3,6,9] - ); + Seq([1, 2, 3]) + .interleave(Seq([4, 5, 6]), Seq([7, 8, 9])) + .toArray() + ).toEqual([1, 4, 7, 2, 5, 8, 3, 6, 9]); }); it('stops at the shortest collection', () => { - var i = I.Seq.of(1,2,3).interleave( - I.Seq.of(4,5), - I.Seq.of(7,8,9) - ); + const i = Seq([1, 2, 3]).interleave(Seq([4, 5]), Seq([7, 8, 9])); expect(i.size).toBe(6); - expect(i.toArray()).toEqual( - [1,4,7,2,5,8] - ); + expect(i.toArray()).toEqual([1, 4, 7, 2, 5, 8]); }); it('with infinite lists', () => { - var r: I.IndexedIterable = I.Range(); - var i = r.interleave(I.Seq.of('A','B','C')); + const r: Seq.Indexed = Range(0, Infinity); + const i = r.interleave(Seq(['A', 'B', 'C'])); expect(i.size).toBe(6); - expect(i.toArray()).toEqual( - [0,'A',1,'B',2,'C'] - ); + expect(i.toArray()).toEqual([0, 'A', 1, 'B', 2, 'C']); }); - }); - }); diff --git a/bower.json b/bower.json deleted file mode 100644 index 97af1e30db..0000000000 --- a/bower.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "immutable", - "description": "Immutable Data Collections", - "homepage": "https://github.com/facebook/immutable-js", - "author": { - "name": "Lee Byron", - "homepage": "https://github.com/leebyron" - }, - "repository": { - "type": "git", - "url": "git://github.com/facebook/immutable-js.git" - }, - "main": "dist/immutable.js", - "ignore": [ - "**/.*", - "__tests__", - "resources", - "src", - "type-definitions", - "package.json", - "Gruntfile.js" - ], - "keywords": [ - "immutable", - "persistent", - "lazy", - "data", - "datastructure", - "functional", - "collection", - "stateless", - "sequence", - "iteration" - ], - "license": "BSD" -} diff --git a/contrib/cursor/README.md b/contrib/cursor/README.md deleted file mode 100644 index 30214321d6..0000000000 --- a/contrib/cursor/README.md +++ /dev/null @@ -1,33 +0,0 @@ -Cursors -------- - -Cursors allow you to hold a reference to a path in a nested immutable data -structure, allowing you to pass smaller sections of a larger nested -collection to portions of your application while maintaining a central point -aware of changes to the entire data structure: an `onChange` function which is -called whenever a cursor or sub-cursor calls `update`. - -This is particularly useful when used in conjuction with component-based UI -libraries like [React](http://facebook.github.io/react/) or to simulate -"state" throughout an application while maintaining a single flow of logic. - - -```javascript -var Immutable = require('immutable'); -var Cursor = require('immutable/contrib/cursor'); - -var data = Immutable.fromJS({ a: { b: { c: 1 } } }); -var cursor = Cursor.from(data, ['a', 'b'], newData => { - data = newData; -}); - -// ... elsewhere ... - -cursor.get('c'); // 1 -cursor = cursor.update('c', x => x + 1); -cursor.get('c'); // 2 - -// ... back to data ... - -data.getIn(['a', 'b', 'c']); // 2 -``` diff --git a/contrib/cursor/__tests__/Cursor.ts b/contrib/cursor/__tests__/Cursor.ts deleted file mode 100644 index 83e54d27a2..0000000000 --- a/contrib/cursor/__tests__/Cursor.ts +++ /dev/null @@ -1,357 +0,0 @@ -/// -/// -/// - -jest.autoMockOff(); - -import Immutable = require('immutable'); -import Cursor = require('immutable/contrib/cursor'); - -jasmine.getEnv().addEqualityTester((a, b) => - a instanceof Immutable.Iterable && b instanceof Immutable.Iterable ? - Immutable.is(a, b) : - jasmine.undefined -); - -describe('Cursor', () => { - - var json = { a: { b: { c: 1 } } }; - - it('gets from its path', () => { - var data = Immutable.fromJS(json); - var cursor = Cursor.from(data); - - expect(cursor.deref()).toBe(data); - - var deepCursor = cursor.cursor(['a', 'b']); - expect(deepCursor.deref().toJS()).toEqual(json.a.b); - expect(deepCursor.deref()).toBe(data.getIn(['a', 'b'])); - expect(deepCursor.get('c')).toBe(1); - - var leafCursor = deepCursor.cursor('c'); - expect(leafCursor.deref()).toBe(1); - - var missCursor = leafCursor.cursor('d'); - expect(missCursor.deref()).toBe(undefined); - }); - - it('gets return new cursors', () => { - var data = Immutable.fromJS(json); - var cursor = Cursor.from(data); - var deepCursor = cursor.getIn(['a', 'b']); - expect(deepCursor.deref()).toBe(data.getIn(['a', 'b'])); - }); - - it('gets return new cursors using List', () => { - var data = Immutable.fromJS(json); - var cursor = Cursor.from(data); - var deepCursor = cursor.getIn(Immutable.fromJS(['a', 'b'])); - expect(deepCursor.deref()).toBe(data.getIn(Immutable.fromJS(['a', 'b']))); - }); - - it('cursor return new cursors of correct type', () => { - var data = Immutable.fromJS({ a: [1, 2, 3] }); - var cursor = Cursor.from(data); - var deepCursor = cursor.cursor('a'); - expect(deepCursor.findIndex).toBeDefined(); - }); - - it('can be treated as a value', () => { - var data = Immutable.fromJS(json); - var cursor = Cursor.from(data, ['a', 'b']); - expect(cursor.toJS()).toEqual(json.a.b); - expect(cursor).toEqual(data.getIn(['a', 'b'])); - expect(cursor.size).toBe(1); - expect(cursor.get('c')).toBe(1); - }); - - it('can be value compared to a primitive', () => { - var data = Immutable.Map({ a: 'A' }); - var aCursor = Cursor.from(data, 'a'); - expect(aCursor.size).toBe(undefined); - expect(aCursor.deref()).toBe('A'); - expect(Immutable.is(aCursor, 'A')).toBe(true); - }); - - it('updates at its path', () => { - var onChange = jest.genMockFunction(); - - var data = Immutable.fromJS(json); - var aCursor = Cursor.from(data, 'a', onChange); - - var deepCursor = aCursor.cursor(['b', 'c']); - expect(deepCursor.deref()).toBe(1); - - // cursor edits return new cursors: - var newDeepCursor = deepCursor.update(x => x + 1); - expect(newDeepCursor.deref()).toBe(2); - expect(onChange).lastCalledWith( - Immutable.fromJS({a:{b:{c:2}}}), - data, - ['a', 'b', 'c'] - ); - - var newestDeepCursor = newDeepCursor.update(x => x + 1); - expect(newestDeepCursor.deref()).toBe(3); - expect(onChange).lastCalledWith( - Immutable.fromJS({a:{b:{c:3}}}), - Immutable.fromJS({a:{b:{c:2}}}), - ['a', 'b', 'c'] - ); - - // meanwhile, data is still immutable: - expect(data.toJS()).toEqual(json); - - // as is the original cursor. - expect(deepCursor.deref()).toBe(1); - var otherNewDeepCursor = deepCursor.update(x => x + 10); - expect(otherNewDeepCursor.deref()).toBe(11); - expect(onChange).lastCalledWith( - Immutable.fromJS({a:{b:{c:11}}}), - data, - ['a', 'b', 'c'] - ); - - // and update has been called exactly thrice. - expect(onChange.mock.calls.length).toBe(3); - }); - - it('updates with the return value of onChange', () => { - var onChange = jest.genMockFunction(); - - var data = Immutable.fromJS(json); - var deepCursor = Cursor.from(data, ['a', 'b', 'c'], onChange); - - onChange.mockReturnValueOnce(undefined); - // onChange returning undefined has no effect - var newCursor = deepCursor.update(x => x + 1); - expect(newCursor.deref()).toBe(2); - expect(onChange).lastCalledWith( - Immutable.fromJS({a:{b:{c:2}}}), - data, - ['a', 'b', 'c'] - ); - - onChange.mockReturnValueOnce(Immutable.fromJS({a:{b:{c:11}}})); - // onChange returning something else has an effect - newCursor = newCursor.update(x => 999); - expect(newCursor.deref()).toBe(11); - expect(onChange).lastCalledWith( - Immutable.fromJS({a:{b:{c:999}}}), - Immutable.fromJS({a:{b:{c:2}}}), - ['a', 'b', 'c'] - ); - - // and update has been called exactly twice - expect(onChange.mock.calls.length).toBe(2); - }); - - it('has map API for update shorthand', () => { - var onChange = jest.genMockFunction(); - - var data = Immutable.fromJS(json); - var aCursor = Cursor.from(data, 'a', onChange); - var bCursor = aCursor.cursor('b'); - var cCursor = bCursor.cursor('c'); - - expect(bCursor.set('c', 10).deref()).toEqual( - Immutable.fromJS({ c: 10 }) - ); - expect(onChange).lastCalledWith( - Immutable.fromJS({ a: { b: { c: 10 } } }), - data, - ['a', 'b', 'c'] - ); - }); - - it('creates maps as necessary', () => { - var data = Immutable.Map(); - var cursor = Cursor.from(data, ['a', 'b', 'c']); - expect(cursor.deref()).toBe(undefined); - cursor = cursor.set('d', 3); - expect(cursor.deref()).toEqual(Immutable.Map({d: 3})); - }); - - it('can set undefined', () => { - var data = Immutable.Map(); - var cursor = Cursor.from(data, ['a', 'b', 'c']); - expect(cursor.deref()).toBe(undefined); - cursor = cursor.set('d', undefined); - expect(cursor.toJS()).toEqual({d: undefined}); - }); - - it('has the sequence API', () => { - var data = Immutable.Map({a: 1, b: 2, c: 3}); - var cursor = Cursor.from(data); - expect(cursor.map((x: number) => x * x)).toEqual(Immutable.Map({a: 1, b: 4, c: 9})); - }); - - it('can push values on a List', () => { - var onChange = jest.genMockFunction(); - var data = Immutable.fromJS({a: {b: [0, 1, 2]}}); - var cursor = Cursor.from(data, ['a', 'b'], onChange); - - expect(cursor.push(3,4)).toEqual(Immutable.List([0, 1, 2, 3, 4])); - expect(onChange).lastCalledWith( - Immutable.fromJS({a: {b: [0, 1, 2, 3, 4]}}), - data, - ['a', 'b'] - ); - }); - - it('can pop values of a List', () => { - var onChange = jest.genMockFunction(); - var data = Immutable.fromJS({a: {b: [0, 1, 2]}}); - var cursor = Cursor.from(data, ['a', 'b'], onChange); - - expect(cursor.pop()).toEqual(Immutable.List([0, 1])); - expect(onChange).lastCalledWith( - Immutable.fromJS({a: {b: [0, 1]}}), - data, - ['a', 'b'] - ); - }); - - it('can unshift values on a List', () => { - var onChange = jest.genMockFunction(); - var data = Immutable.fromJS({a: {b: [0, 1, 2]}}); - var cursor = Cursor.from(data, ['a', 'b'], onChange); - - expect(cursor.unshift(-2, -1)).toEqual(Immutable.List([-2, -1, 0, 1, 2])); - expect(onChange).lastCalledWith( - Immutable.fromJS({a: {b: [-2, -1, 0, 1, 2]}}), - data, - ['a', 'b'] - ); - }); - - it('can shift values of a List', () => { - var onChange = jest.genMockFunction(); - var data = Immutable.fromJS({a: {b: [0, 1, 2]}}); - var cursor = Cursor.from(data, ['a', 'b'], onChange); - - expect(cursor.shift()).toEqual(Immutable.List([1, 2])); - expect(onChange).lastCalledWith( - Immutable.fromJS({a: {b: [1, 2]}}), - data, - ['a', 'b'] - ); - }); - - - it('returns wrapped values for sequence API', () => { - var data = Immutable.fromJS({a: {v: 1}, b: {v: 2}, c: {v: 3}}); - var onChange = jest.genMockFunction(); - var cursor = Cursor.from(data, onChange); - - var found = cursor.find(map => map.get('v') === 2); - expect(typeof found.deref).toBe('function'); // is a cursor! - found = found.set('v', 20); - expect(onChange).lastCalledWith( - Immutable.fromJS({a: {v: 1}, b: {v: 20}, c: {v: 3}}), - data, - ['b', 'v'] - ); - }); - - it('returns wrapped values for iteration API', () => { - var jsData = [{val: 0}, {val: 1}, {val: 2}]; - var data = Immutable.fromJS(jsData); - var cursor = Cursor.from(data); - cursor.forEach(function (c, i) { - expect(typeof c.deref).toBe('function'); // is a cursor! - expect(c.get('val')).toBe(i); - }); - }); - - it('can map over values to get subcursors', () => { - var data = Immutable.fromJS({a: {v: 1}, b: {v: 2}, c: {v: 3}}); - var cursor = Cursor.from(data); - - var mapped = cursor.map(val => { - expect(typeof val.deref).toBe('function'); // mapped values are cursors. - return val; - }).toMap(); - // Mapped is not a cursor, but it is a sequence of cursors. - expect(typeof (mapped).deref).not.toBe('function'); - expect(typeof (mapped.get('a')).deref).toBe('function'); - - // Same for indexed cursors - var data2 = Immutable.fromJS({x: [{v: 1}, {v: 2}, {v: 3}]}); - var cursor2 = Cursor.from(data2); - - var mapped2 = cursor2.get('x').map(val => { - expect(typeof val.deref).toBe('function'); // mapped values are cursors. - return val; - }).toList(); - // Mapped is not a cursor, but it is a sequence of cursors. - expect(typeof mapped2.deref).not.toBe('function'); - expect(typeof mapped2.get(0).deref).toBe('function'); - }); - - it('can have mutations apply with a single callback', () => { - var onChange = jest.genMockFunction(); - var data = Immutable.fromJS({'a': 1}); - - var c1 = Cursor.from(data, onChange); - var c2 = c1.withMutations(m => m.set('b', 2).set('c', 3).set('d', 4)); - - expect(c1.deref().toObject()).toEqual({'a': 1}); - expect(c2.deref().toObject()).toEqual({'a': 1, 'b': 2, 'c': 3, 'd': 4}); - expect(onChange.mock.calls.length).toBe(1); - }); - - it('can use withMutations on an unfulfilled cursor', () => { - var onChange = jest.genMockFunction(); - var data = Immutable.fromJS({}); - - var c1 = Cursor.from(data, ['a', 'b', 'c'], onChange); - var c2 = c1.withMutations(m => m.set('x', 1).set('y', 2).set('z', 3)); - - expect(c1.deref()).toEqual(undefined); - expect(c2.deref()).toEqual(Immutable.fromJS( - { x: 1, y: 2, z: 3 } - )); - expect(onChange.mock.calls.length).toBe(1); - }); - - it('maintains indexed sequences', () => { - var data = Immutable.fromJS([]); - var c = Cursor.from(data); - expect(c.toJS()).toEqual([]); - }); - - it('properly acts as an iterable', () => { - var data = Immutable.fromJS({key: {val: 1}}); - var c = Cursor.from(data).values(); - var c1 = c.next().value.get('val'); - expect(c1).toBe(1); - }); - - it('can update deeply', () => { - var onChange = jest.genMockFunction(); - var data = Immutable.fromJS({a:{b:{c:1}}}); - var c = Cursor.from(data, ['a'], onChange); - var c1 = c.updateIn(['b', 'c'], x => x * 10); - expect(c1.getIn(['b', 'c'])).toBe(10); - expect(onChange).lastCalledWith( - Immutable.fromJS({a:{b:{c:10}}}), - data, - ['a', 'b', 'c'] - ); - }); - - it('can set deeply', () => { - var onChange = jest.genMockFunction(); - var data = Immutable.fromJS({a:{b:{c:1}}}); - var c = Cursor.from(data, ['a'], onChange); - var c1 = c.setIn(['b', 'c'], 10); - expect(c1.getIn(['b', 'c'])).toBe(10); - expect(onChange).lastCalledWith( - Immutable.fromJS({a:{b:{c:10}}}), - data, - ['a', 'b', 'c'] - ); - }); - -}); diff --git a/contrib/cursor/index.d.ts b/contrib/cursor/index.d.ts deleted file mode 100644 index d055edd434..0000000000 --- a/contrib/cursor/index.d.ts +++ /dev/null @@ -1,288 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - - -/** - * Cursors - * ------- - * - * Cursors allow you to hold a reference to a path in a nested immutable data - * structure, allowing you to pass smaller sections of a larger nested - * collection to portions of your application while maintaining a central point - * aware of changes to the entire data structure. - * - * This is particularly useful when used in conjuction with component-based UI - * libraries like [React](http://facebook.github.io/react/) or to simulate - * "state" throughout an application while maintaining a single flow of logic. - * - * Cursors provide a simple API for getting the value at that path - * (the equivalent of `this.getIn(keyPath)`), updating the value at that path - * (the equivalent of `this.updateIn(keyPath)`), and getting a sub-cursor - * starting from that path. - * - * When updated, a new root collection is created and provided to the `onChange` - * function provided to the first call to `Cursor(map, onChange)`. - * - * When this cursor's (or any of its sub-cursors') `update` method is called, - * the resulting new data structure will be provided to the `onChange` - * function. Use this callback to keep track of the most current value or - * update the rest of your application. - */ - -declare module 'immutable/contrib/cursor' { - - /// - import Immutable = require('immutable'); - - - export function from( - collection: Immutable.Collection, - onChange?: (newValue: any, oldValue?: any, keyPath?: Array) => any - ): Cursor; - export function from( - collection: Immutable.Collection, - keyPath: Array, - onChange?: (newValue: any, oldValue?: any, keyPath?: Array) => any - ): Cursor; - export function from( - collection: Immutable.Collection, - key: any, - onChange?: (newValue: any, oldValue?: any, keyPath?: Array) => any - ): Cursor; - - - export interface Cursor extends Immutable.Seq { - - /** - * Returns a sub-cursor following the key-path starting from this cursor. - */ - cursor(subKeyPath: Array): Cursor; - cursor(subKey: any): Cursor; - - /** - * Returns the value at the cursor, if the cursor path does not yet exist, - * returns `notSetValue`. - */ - deref(notSetValue?: any): any; - - /** - * Returns the value at the `key` in the cursor, or `notSetValue` if it - * does not exist. - * - * If the key would return a collection, a new Cursor is returned. - */ - get(key: any, notSetValue?: any): any; - - /** - * Returns the value at the `keyPath` in the cursor, or `notSetValue` if it - * does not exist. - * - * If the keyPath would return a collection, a new Cursor is returned. - */ - getIn(keyPath: Array, notSetValue?: any): any; - getIn(keyPath: Immutable.Iterable, notSetValue?: any): any; - - /** - * Sets `value` at `key` in the cursor, returning a new cursor to the same - * point in the new data. - */ - set(key: any, value: any): Cursor; - - /** - * Deletes `key` from the cursor, returning a new cursor to the same - * point in the new data. - * - * Note: `delete` cannot be safely used in IE8 - * @alias remove - */ - delete(key: any): Cursor; - remove(key: any): Cursor; - - /** - * Clears the value at this cursor, returning a new cursor to the same - * point in the new data. - */ - clear(): Cursor; - - /** - * Updates the value in the data this cursor points to, triggering the - * callback for the root cursor and returning a new cursor pointing to the - * new data. - */ - update(updater: (value: any) => any): Cursor; - update(key: any, updater: (value: any) => any): Cursor; - update(key: any, notSetValue: any, updater: (value: any) => any): Cursor; - - /** - * @see `Map#merge` - */ - merge(...iterables: Immutable.Iterable[]): Cursor; - merge(...iterables: {[key: string]: any}[]): Cursor; - - /** - * @see `Map#mergeWith` - */ - mergeWith( - merger: (previous?: any, next?: any) => any, - ...iterables: Immutable.Iterable[] - ): Cursor; - mergeWith( - merger: (previous?: any, next?: any) => any, - ...iterables: {[key: string]: any}[] - ): Cursor; - - /** - * @see `Map#mergeDeep` - */ - mergeDeep(...iterables: Immutable.Iterable[]): Cursor; - mergeDeep(...iterables: {[key: string]: any}[]): Cursor; - - /** - * @see `Map#mergeDeepWith` - */ - mergeDeepWith( - merger: (previous?: any, next?: any) => any, - ...iterables: Immutable.Iterable[] - ): Cursor; - mergeDeepWith( - merger: (previous?: any, next?: any) => any, - ...iterables: {[key: string]: any}[] - ): Cursor; - - // Deep persistent changes - - /** - * Returns a new Cursor having set `value` at this `keyPath`. If any keys in - * `keyPath` do not exist, a new immutable Map will be created at that key. - */ - setIn(keyPath: Array, value: any): Cursor; - setIn(keyPath: Immutable.Iterable, value: any): Cursor; - - /** - * Returns a new Cursor with provided `values` appended - */ - push(...values: Array): Cursor; - - /** - * Returns a new Cursor with a size ones less than this Cursor, - * excluding the last index in this Cursor. - */ - pop(): Cursor; - - /** - * Returns a new Cursor with the provided `values` prepended, - * shifting other values ahead to higher indices. - */ - unshift(...values: Array): Cursor; - - /** - * Returns a new Cursor with a size ones less than this Cursor, excluding - * the first index in this Cursor, shifting all other values to a lower index. - */ - shift(): Cursor; - - /** - * Returns a new Cursor having removed the value at this `keyPath`. - * - * @alias removeIn - */ - deleteIn(keyPath: Array): Cursor; - deleteIn(keyPath: Immutable.Iterable): Cursor; - removeIn(keyPath: Array): Cursor; - removeIn(keyPath: Immutable.Iterable): Cursor; - - /** - * Returns a new Cursor having applied the `updater` to the value found at - * the keyPath. - * - * If any keys in `keyPath` do not exist, new Immutable `Map`s will - * be created at those keys. If the `keyPath` does not already contain a - * value, the `updater` function will be called with `notSetValue`, if - * provided, otherwise `undefined`. - * - * If the `updater` function returns the same value it was called with, then - * no change will occur. This is still true if `notSetValue` is provided. - */ - updateIn( - keyPath: Array, - updater: (value: any) => any - ): Cursor; - updateIn( - keyPath: Array, - notSetValue: any, - updater: (value: any) => any - ): Cursor; - updateIn( - keyPath: Immutable.Iterable, - updater: (value: any) => any - ): Cursor; - updateIn( - keyPath: Immutable.Iterable, - notSetValue: any, - updater: (value: any) => any - ): Cursor; - - /** - * A combination of `updateIn` and `merge`, returning a new Cursor, but - * performing the merge at a point arrived at by following the keyPath. - * In other words, these two lines are equivalent: - * - * x.updateIn(['a', 'b', 'c'], abc => abc.merge(y)); - * x.mergeIn(['a', 'b', 'c'], y); - * - */ - mergeIn( - keyPath: Immutable.Iterable, - ...iterables: Immutable.Iterable[] - ): Cursor; - mergeIn( - keyPath: Array, - ...iterables: Immutable.Iterable[] - ): Cursor; - mergeIn( - keyPath: Array, - ...iterables: {[key: string]: any}[] - ): Cursor; - - /** - * A combination of `updateIn` and `mergeDeep`, returning a new Cursor, but - * performing the deep merge at a point arrived at by following the keyPath. - * In other words, these two lines are equivalent: - * - * x.updateIn(['a', 'b', 'c'], abc => abc.mergeDeep(y)); - * x.mergeDeepIn(['a', 'b', 'c'], y); - * - */ - mergeDeepIn( - keyPath: Immutable.Iterable, - ...iterables: Immutable.Iterable[] - ): Cursor; - mergeDeepIn( - keyPath: Array, - ...iterables: Immutable.Iterable[] - ): Cursor; - mergeDeepIn( - keyPath: Array, - ...iterables: {[key: string]: any}[] - ): Cursor; - - // Transient changes - - /** - * Every time you call one of the above functions, a new immutable value is - * created and the callback is triggered. If you need to apply a series of - * mutations to a Cursor without triggering the callback repeatedly, - * `withMutations()` creates a temporary mutable copy of the value which - * can apply mutations in a highly performant manner. Afterwards the - * callback is triggered with the final value. - */ - withMutations(mutator: (mutable: any) => any): Cursor; - } - -} diff --git a/contrib/cursor/index.js b/contrib/cursor/index.js deleted file mode 100644 index c6d5d9909b..0000000000 --- a/contrib/cursor/index.js +++ /dev/null @@ -1,311 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -/** - * Cursor is expected to be required in a node or other CommonJS context: - * - * var Cursor = require('immutable/contrib/cursor'); - * - * If you wish to use it in the browser, please check out Browserify or WebPack! - */ - -var Immutable = require('immutable'); -var Iterable = Immutable.Iterable; -var Iterator = Iterable.Iterator; -var Seq = Immutable.Seq; -var Map = Immutable.Map; - - -function cursorFrom(rootData, keyPath, onChange) { - if (arguments.length === 1) { - keyPath = []; - } else if (typeof keyPath === 'function') { - onChange = keyPath; - keyPath = []; - } else { - keyPath = valToKeyPath(keyPath); - } - return makeCursor(rootData, keyPath, onChange); -} - - -var KeyedCursorPrototype = Object.create(Seq.Keyed.prototype); -var IndexedCursorPrototype = Object.create(Seq.Indexed.prototype); - -function KeyedCursor(rootData, keyPath, onChange, size) { - this.size = size; - this._rootData = rootData; - this._keyPath = keyPath; - this._onChange = onChange; -} -KeyedCursorPrototype.constructor = KeyedCursor; - -function IndexedCursor(rootData, keyPath, onChange, size) { - this.size = size; - this._rootData = rootData; - this._keyPath = keyPath; - this._onChange = onChange; -} -IndexedCursorPrototype.constructor = IndexedCursor; - -KeyedCursorPrototype.toString = function() { - return this.__toString('Cursor {', '}'); -} -IndexedCursorPrototype.toString = function() { - return this.__toString('Cursor [', ']'); -} - -KeyedCursorPrototype.deref = -KeyedCursorPrototype.valueOf = -IndexedCursorPrototype.deref = -IndexedCursorPrototype.valueOf = function(notSetValue) { - return this._rootData.getIn(this._keyPath, notSetValue); -} - -KeyedCursorPrototype.get = -IndexedCursorPrototype.get = function(key, notSetValue) { - return this.getIn([key], notSetValue); -} - -KeyedCursorPrototype.getIn = -IndexedCursorPrototype.getIn = function(keyPath, notSetValue) { - keyPath = listToKeyPath(keyPath); - if (keyPath.length === 0) { - return this; - } - var value = this._rootData.getIn(newKeyPath(this._keyPath, keyPath), NOT_SET); - return value === NOT_SET ? notSetValue : wrappedValue(this, keyPath, value); -} - -IndexedCursorPrototype.set = -KeyedCursorPrototype.set = function(key, value) { - return updateCursor(this, function (m) { return m.set(key, value); }, [key]); -} - -IndexedCursorPrototype.push = function(/* values */) { - var args = arguments; - return updateCursor(this, function (m) { - return m.push.apply(m, args); - }); -} - -IndexedCursorPrototype.pop = function() { - return updateCursor(this, function (m) { - return m.pop(); - }); -} - -IndexedCursorPrototype.unshift = function(/* values */) { - var args = arguments; - return updateCursor(this, function (m) { - return m.unshift.apply(m, args); - }); -} - -IndexedCursorPrototype.shift = function() { - return updateCursor(this, function (m) { - return m.shift(); - }); -} - -IndexedCursorPrototype.setIn = -KeyedCursorPrototype.setIn = Map.prototype.setIn; - -KeyedCursorPrototype.remove = -KeyedCursorPrototype['delete'] = -IndexedCursorPrototype.remove = -IndexedCursorPrototype['delete'] = function(key) { - return updateCursor(this, function (m) { return m.remove(key); }, [key]); -} - -IndexedCursorPrototype.removeIn = -IndexedCursorPrototype.deleteIn = -KeyedCursorPrototype.removeIn = -KeyedCursorPrototype.deleteIn = Map.prototype.deleteIn; - -KeyedCursorPrototype.clear = -IndexedCursorPrototype.clear = function() { - return updateCursor(this, function (m) { return m.clear(); }); -} - -IndexedCursorPrototype.update = -KeyedCursorPrototype.update = function(keyOrFn, notSetValue, updater) { - return arguments.length === 1 ? - updateCursor(this, keyOrFn) : - this.updateIn([keyOrFn], notSetValue, updater); -} - -IndexedCursorPrototype.updateIn = -KeyedCursorPrototype.updateIn = function(keyPath, notSetValue, updater) { - return updateCursor(this, function (m) { - return m.updateIn(keyPath, notSetValue, updater); - }, keyPath); -} - -IndexedCursorPrototype.merge = -KeyedCursorPrototype.merge = function(/*...iters*/) { - var args = arguments; - return updateCursor(this, function (m) { - return m.merge.apply(m, args); - }); -} - -IndexedCursorPrototype.mergeWith = -KeyedCursorPrototype.mergeWith = function(merger/*, ...iters*/) { - var args = arguments; - return updateCursor(this, function (m) { - return m.mergeWith.apply(m, args); - }); -} - -IndexedCursorPrototype.mergeIn = -KeyedCursorPrototype.mergeIn = Map.prototype.mergeIn; - -IndexedCursorPrototype.mergeDeep = -KeyedCursorPrototype.mergeDeep = function(/*...iters*/) { - var args = arguments; - return updateCursor(this, function (m) { - return m.mergeDeep.apply(m, args); - }); -} - -IndexedCursorPrototype.mergeDeepWith = -KeyedCursorPrototype.mergeDeepWith = function(merger/*, ...iters*/) { - var args = arguments; - return updateCursor(this, function (m) { - return m.mergeDeepWith.apply(m, args); - }); -} - -IndexedCursorPrototype.mergeDeepIn = -KeyedCursorPrototype.mergeDeepIn = Map.prototype.mergeDeepIn; - -KeyedCursorPrototype.withMutations = -IndexedCursorPrototype.withMutations = function(fn) { - return updateCursor(this, function (m) { - return (m || Map()).withMutations(fn); - }); -} - -KeyedCursorPrototype.cursor = -IndexedCursorPrototype.cursor = function(subKeyPath) { - subKeyPath = valToKeyPath(subKeyPath); - return subKeyPath.length === 0 ? this : subCursor(this, subKeyPath); -} - -/** - * All iterables need to implement __iterate - */ -KeyedCursorPrototype.__iterate = -IndexedCursorPrototype.__iterate = function(fn, reverse) { - var cursor = this; - var deref = cursor.deref(); - return deref && deref.__iterate ? deref.__iterate( - function (v, k) { return fn(wrappedValue(cursor, [k], v), k, cursor); }, - reverse - ) : 0; -} - -/** - * All iterables need to implement __iterator - */ -KeyedCursorPrototype.__iterator = -IndexedCursorPrototype.__iterator = function(type, reverse) { - var deref = this.deref(); - var cursor = this; - var iterator = deref && deref.__iterator && - deref.__iterator(Iterator.ENTRIES, reverse); - return new Iterator(function () { - if (!iterator) { - return { value: undefined, done: true }; - } - var step = iterator.next(); - if (step.done) { - return step; - } - var entry = step.value; - var k = entry[0]; - var v = wrappedValue(cursor, [k], entry[1]); - return { - value: type === Iterator.KEYS ? k : type === Iterator.VALUES ? v : [k, v], - done: false - }; - }); -} - -KeyedCursor.prototype = KeyedCursorPrototype; -IndexedCursor.prototype = IndexedCursorPrototype; - - -var NOT_SET = {}; // Sentinel value - -function makeCursor(rootData, keyPath, onChange, value) { - if (arguments.length < 4) { - value = rootData.getIn(keyPath); - } - var size = value && value.size; - var CursorClass = Iterable.isIndexed(value) ? IndexedCursor : KeyedCursor; - return new CursorClass(rootData, keyPath, onChange, size); -} - -function wrappedValue(cursor, keyPath, value) { - return Iterable.isIterable(value) ? subCursor(cursor, keyPath, value) : value; -} - -function subCursor(cursor, keyPath, value) { - if (arguments.length < 3) { - return makeCursor( // call without value - cursor._rootData, - newKeyPath(cursor._keyPath, keyPath), - cursor._onChange - ); - } - return makeCursor( - cursor._rootData, - newKeyPath(cursor._keyPath, keyPath), - cursor._onChange, - value - ); -} - -function updateCursor(cursor, changeFn, changeKeyPath) { - var deepChange = arguments.length > 2; - var newRootData = cursor._rootData.updateIn( - cursor._keyPath, - deepChange ? Map() : undefined, - changeFn - ); - var keyPath = cursor._keyPath || []; - var result = cursor._onChange && cursor._onChange.call( - undefined, - newRootData, - cursor._rootData, - deepChange ? newKeyPath(keyPath, changeKeyPath) : keyPath - ); - if (result !== undefined) { - newRootData = result; - } - return makeCursor(newRootData, cursor._keyPath, cursor._onChange); -} - -function newKeyPath(head, tail) { - return head.concat(listToKeyPath(tail)); -} - -function listToKeyPath(list) { - return Array.isArray(list) ? list : Immutable.Iterable(list).toArray(); -} - -function valToKeyPath(val) { - return Array.isArray(val) ? val : - Iterable.isIterable(val) ? val.toArray() : - [val]; -} - -exports.from = cursorFrom; diff --git a/dist/immutable.d.ts b/dist/immutable.d.ts deleted file mode 100644 index 93bcad66e7..0000000000 --- a/dist/immutable.d.ts +++ /dev/null @@ -1,2460 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -/** - * Immutable data encourages pure functions (data-in, data-out) and lends itself - * to much simpler application development and enabling techniques from - * functional programming such as lazy evaluation. - * - * While designed to bring these powerful functional concepts to JavaScript, it - * presents an Object-Oriented API familiar to Javascript engineers and closely - * mirroring that of Array, Map, and Set. It is easy and efficient to convert to - * and from plain Javascript types. - - * Note: all examples are presented in [ES6][]. To run in all browsers, they - * need to be translated to ES3. For example: - * - * // ES6 - * foo.map(x => x * x); - * // ES3 - * foo.map(function (x) { return x * x; }); - * - * [ES6]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla - */ - -declare module 'immutable' { - - /** - * Deeply converts plain JS objects and arrays to Immutable Maps and Lists. - * - * If a `reviver` is optionally provided, it will be called with every - * collection as a Seq (beginning with the most nested collections - * and proceeding to the top-level collection itself), along with the key - * refering to each collection and the parent JS object provided as `this`. - * For the top level, object, the key will be `""`. This `reviver` is expected - * to return a new Immutable Iterable, allowing for custom convertions from - * deep JS objects. - * - * This example converts JSON to List and OrderedMap: - * - * Immutable.fromJS({a: {b: [10, 20, 30]}, c: 40}, function (key, value) { - * var isIndexed = Immutable.Iterable.isIndexed(value); - * return isIndexed ? value.toList() : value.toOrderedMap(); - * }); - * - * // true, "b", {b: [10, 20, 30]} - * // false, "a", {a: {b: [10, 20, 30]}, c: 40} - * // false, "", {"": {a: {b: [10, 20, 30]}, c: 40}} - * - * If `reviver` is not provided, the default behavior will convert Arrays into - * Lists and Objects into Maps. - * - * `reviver` acts similarly to the [same parameter in `JSON.parse`][1]. - * - * `Immutable.fromJS` is conservative in it's conversion. It will only convert - * arrays which pass `Array.isArray` to Lists, and only raw objects (no custom - * prototype) to Map. - * - * [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter - * "Using the reviver parameter" - */ - export function fromJS( - json: any, - reviver?: (k: any, v: Iterable) => any - ): any; - - - /** - * Value equality check with semantics similar to `Object.is`, but treats - * Immutable `Iterable`s as values, equal if the second `Iterable` includes - * equivalent values. - * - * It's used throughout Immutable when checking for equality, including `Map` - * key equality and `Set` membership. - * - * var map1 = Immutable.Map({a:1, b:1, c:1}); - * var map2 = Immutable.Map({a:1, b:1, c:1}); - * assert(map1 !== map2); - * assert(Object.is(map1, map2) === false); - * assert(Immutable.is(map1, map2) === true); - * - * Note: Unlike `Object.is`, `Immutable.is` assumes `0` and `-0` are the same - * value, matching the behavior of ES6 Map key equality. - */ - export function is(first: any, second: any): boolean; - - - /** - * Lists are ordered indexed dense collections, much like a JavaScript - * Array. - * - * Lists are immutable and fully persistent with O(log32 N) gets and sets, - * and O(1) push and pop. - * - * Lists implement Deque, with efficient addition and removal from both the - * end (`push`, `pop`) and beginning (`unshift`, `shift`). - * - * Unlike a JavaScript Array, there is no distinction between an - * "unset" index and an index set to `undefined`. `List#forEach` visits all - * indices from 0 to size, regardless of if they where explicitly defined. - */ - export module List { - - /** - * True if the provided value is a List - */ - function isList(maybeList: any): boolean; - - /** - * Creates a new List containing `values`. - */ - function of(...values: T[]): List; - } - - /** - * Create a new immutable List containing the values of the provided - * iterable-like. - */ - export function List(): List; - export function List(iter: IndexedIterable): List; - export function List(iter: SetIterable): List; - export function List(iter: KeyedIterable): List; - export function List(array: Array): List; - export function List(iterator: Iterator): List; - export function List(iterable: /*Iterable*/Object): List; - - - export interface List extends IndexedCollection { - - // Persistent changes - - /** - * Returns a new List which includes `value` at `index`. If `index` already - * exists in this List, it will be replaced. - * - * `index` may be a negative number, which indexes back from the end of the - * List. `v.set(-1, "value")` sets the last item in the List. - * - * If `index` larger than `size`, the returned List's `size` will be large - * enough to include the `index`. - */ - set(index: number, value: T): List; - - /** - * Returns a new List which excludes this `index` and with a size 1 less - * than this List. Values at indicies above `index` are shifted down by 1 to - * fill the position. - * - * This is synonymous with `list.splice(index, 1)`. - * - * `index` may be a negative number, which indexes back from the end of the - * List. `v.delete(-1)` deletes the last item in the List. - * - * Note: `delete` cannot be safely used in IE8 - * @alias remove - */ - delete(index: number): List; - remove(index: number): List; - - /** - * Returns a new List with 0 size and no values. - */ - clear(): List; - - /** - * Returns a new List with the provided `values` appended, starting at this - * List's `size`. - */ - push(...values: T[]): List; - - /** - * Returns a new List with a size ones less than this List, excluding - * the last index in this List. - * - * Note: this differs from `Array#pop` because it returns a new - * List rather than the removed value. Use `last()` to get the last value - * in this List. - */ - pop(): List; - - /** - * Returns a new List with the provided `values` prepended, shifting other - * values ahead to higher indices. - */ - unshift(...values: T[]): List; - - /** - * Returns a new List with a size ones less than this List, excluding - * the first index in this List, shifting all other values to a lower index. - * - * Note: this differs from `Array#shift` because it returns a new - * List rather than the removed value. Use `first()` to get the first - * value in this List. - */ - shift(): List; - - /** - * Returns a new List with an updated value at `index` with the return - * value of calling `updater` with the existing value, or `notSetValue` if - * `index` was not set. If called with a single argument, `updater` is - * called with the List itself. - * - * `index` may be a negative number, which indexes back from the end of the - * List. `v.update(-1)` updates the last item in the List. - * - * @see `Map#update` - */ - update(updater: (value: List) => List): List; - update(index: number, updater: (value: T) => T): List; - update(index: number, notSetValue: T, updater: (value: T) => T): List; - - /** - * @see `Map#merge` - */ - merge(...iterables: IndexedIterable[]): List; - merge(...iterables: Array[]): List; - - /** - * @see `Map#mergeWith` - */ - mergeWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: IndexedIterable[] - ): List; - mergeWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: Array[] - ): List; - - /** - * @see `Map#mergeDeep` - */ - mergeDeep(...iterables: IndexedIterable[]): List; - mergeDeep(...iterables: Array[]): List; - - /** - * @see `Map#mergeDeepWith` - */ - mergeDeepWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: IndexedIterable[] - ): List; - mergeDeepWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: Array[] - ): List; - - /** - * Returns a new List with size `size`. If `size` is less than this - * List's size, the new List will exclude values at the higher indices. - * If `size` is greater than this List's size, the new List will have - * undefined values for the newly available indices. - * - * When building a new List and the final size is known up front, `setSize` - * used in conjunction with `withMutations` may result in the more - * performant construction. - */ - setSize(size: number): List; - - - // Deep persistent changes - - /** - * Returns a new List having set `value` at this `keyPath`. If any keys in - * `keyPath` do not exist, a new immutable Map will be created at that key. - * - * Index numbers are used as keys to determine the path to follow in - * the List. - */ - setIn(keyPath: Array, value: any): List; - setIn(keyPath: Iterable, value: any): List; - - /** - * Returns a new List having removed the value at this `keyPath`. If any - * keys in `keyPath` do not exist, no change will occur. - * - * @alias removeIn - */ - deleteIn(keyPath: Array): List; - deleteIn(keyPath: Iterable): List; - removeIn(keyPath: Array): List; - removeIn(keyPath: Iterable): List; - - /** - * @see `Map#updateIn` - */ - updateIn( - keyPath: Array, - updater: (value: any) => any - ): List; - updateIn( - keyPath: Array, - notSetValue: any, - updater: (value: any) => any - ): List; - updateIn( - keyPath: Iterable, - updater: (value: any) => any - ): List; - updateIn( - keyPath: Iterable, - notSetValue: any, - updater: (value: any) => any - ): List; - - /** - * @see `Map#mergeIn` - */ - mergeIn( - keyPath: Iterable, - ...iterables: IndexedIterable[] - ): List; - mergeIn( - keyPath: Array, - ...iterables: IndexedIterable[] - ): List; - mergeIn( - keyPath: Array, - ...iterables: Array[] - ): List; - - /** - * @see `Map#mergeDeepIn` - */ - mergeDeepIn( - keyPath: Iterable, - ...iterables: IndexedIterable[] - ): List; - mergeDeepIn( - keyPath: Array, - ...iterables: IndexedIterable[] - ): List; - mergeDeepIn( - keyPath: Array, - ...iterables: Array[] - ): List; - - - // Transient changes - - /** - * @see `Map#withMutations` - */ - withMutations(mutator: (mutable: List) => any): List; - - /** - * @see `Map#asMutable` - */ - asMutable(): List; - - /** - * @see `Map#asImmutable` - */ - asImmutable(): List; - } - - - /** - * Immutable Map is an unordered KeyedIterable of (key, value) pairs with - * `O(log32 N)` gets and `O(log32 N)` persistent sets. - * - * Iteration order of a Map is undefined, however is stable. Multiple - * iterations of the same Map will iterate in the same order. - * - * Map's keys can be of any type, and use `Immutable.is` to determine key - * equality. This allows the use of any value (including NaN) as a key. - * - * Because `Immutable.is` returns equality based on value semantics, and - * Immutable collections are treated as values, any Immutable collection may - * be used as a key. - * - * Map().set(List.of(1), 'listofone').get(List.of(1)); - * // 'listofone' - * - * Any JavaScript object may be used as a key, however strict identity is used - * to evaluate key equality. Two similar looking objects will represent two - * different keys. - * - * Implemented by a hash-array mapped trie. - */ - export module Map { - - /** - * True if the provided value is a Map - */ - function isMap(maybeMap: any): boolean; - } - - /** - * Creates a new Immutable Map. - * - * Created with the same key value pairs as the provided KeyedIterable or - * JavaScript Object or expects an Iterable of [K, V] tuple entries. - * - * var newMap = Map({key: "value"}); - * var newMap = Map([["key", "value"]]); - * - */ - export function Map(): Map; - export function Map(iter: KeyedIterable): Map; - export function Map(iter: Iterable>): Map; - export function Map(array: Array>): Map; - export function Map(obj: {[key: string]: V}): Map; - export function Map(iterator: Iterator>): Map; - export function Map(iterable: /*Iterable<[K,V]>*/Object): Map; - - export interface Map extends KeyedCollection { - - // Persistent changes - - /** - * Returns a new Map also containing the new key, value pair. If an equivalent - * key already exists in this Map, it will be replaced. - */ - set(key: K, value: V): Map; - - /** - * Returns a new Map which excludes this `key`. - * - * Note: `delete` cannot be safely used in IE8, but is provided to mirror - * the ES6 collection API. - * @alias remove - */ - delete(key: K): Map; - remove(key: K): Map; - - /** - * Returns a new Map containing no keys or values. - */ - clear(): Map; - - /** - * Returns a new Map having updated the value at this `key` with the return - * value of calling `updater` with the existing value, or `notSetValue` if - * the key was not set. If called with only a single argument, `updater` is - * called with the Map itself. - * - * Equivalent to: `map.set(key, updater(map.get(key, notSetValue)))`. - */ - update(updater: (value: Map) => Map): Map; - update(key: K, updater: (value: V) => V): Map; - update(key: K, notSetValue: V, updater: (value: V) => V): Map; - - /** - * Returns a new Map resulting from merging the provided Iterables - * (or JS objects) into this Map. In other words, this takes each entry of - * each iterable and sets it on this Map. - * - * If any of the values provided to `merge` are not Iterable (would return - * false for `Immutable.isIterable`) then they are deeply converted via - * `Immutable.fromJS` before being merged. However, if the value is an - * Iterable but includes non-iterable JS objects or arrays, those nested - * values will be preserved. - * - * var x = Immutable.Map({a: 10, b: 20, c: 30}); - * var y = Immutable.Map({b: 40, a: 50, d: 60}); - * x.merge(y) // { a: 50, b: 40, c: 30, d: 60 } - * y.merge(x) // { b: 20, a: 10, d: 60, c: 30 } - * - */ - merge(...iterables: Iterable[]): Map; - merge(...iterables: {[key: string]: V}[]): Map; - - /** - * Like `merge()`, `mergeWith()` returns a new Map resulting from merging - * the provided Iterables (or JS objects) into this Map, but uses the - * `merger` function for dealing with conflicts. - * - * var x = Immutable.Map({a: 10, b: 20, c: 30}); - * var y = Immutable.Map({b: 40, a: 50, d: 60}); - * x.mergeWith((prev, next) => prev / next, y) // { a: 0.2, b: 0.5, c: 30, d: 60 } - * y.mergeWith((prev, next) => prev / next, x) // { b: 2, a: 5, d: 60, c: 30 } - * - */ - mergeWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: Iterable[] - ): Map; - mergeWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: {[key: string]: V}[] - ): Map; - - /** - * Like `merge()`, but when two Iterables conflict, it merges them as well, - * recursing deeply through the nested data. - * - * var x = Immutable.fromJS({a: { x: 10, y: 10 }, b: { x: 20, y: 50 } }); - * var y = Immutable.fromJS({a: { x: 2 }, b: { y: 5 }, c: { z: 3 } }); - * x.mergeDeep(y) // {a: { x: 2, y: 10 }, b: { x: 20, y: 5 }, c: { z: 3 } } - * - */ - mergeDeep(...iterables: Iterable[]): Map; - mergeDeep(...iterables: {[key: string]: V}[]): Map; - - /** - * Like `mergeDeep()`, but when two non-Iterables conflict, it uses the - * `merger` function to determine the resulting value. - * - * var x = Immutable.fromJS({a: { x: 10, y: 10 }, b: { x: 20, y: 50 } }); - * var y = Immutable.fromJS({a: { x: 2 }, b: { y: 5 }, c: { z: 3 } }); - * x.mergeDeepWith((prev, next) => prev / next, y) - * // {a: { x: 5, y: 10 }, b: { x: 20, y: 10 }, c: { z: 3 } } - * - */ - mergeDeepWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: Iterable[] - ): Map; - mergeDeepWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: {[key: string]: V}[] - ): Map; - - - // Deep persistent changes - - /** - * Returns a new Map having set `value` at this `keyPath`. If any keys in - * `keyPath` do not exist, a new immutable Map will be created at that key. - */ - setIn(keyPath: Array, value: any): Map; - setIn(KeyPath: Iterable, value: any): Map; - - /** - * Returns a new Map having removed the value at this `keyPath`. If any keys - * in `keyPath` do not exist, no change will occur. - * - * @alias removeIn - */ - deleteIn(keyPath: Array): Map; - deleteIn(keyPath: Iterable): Map; - removeIn(keyPath: Array): Map; - removeIn(keyPath: Iterable): Map; - - /** - * Returns a new Map having applied the `updater` to the entry found at the - * keyPath. - * - * If any keys in `keyPath` do not exist, new Immutable `Map`s will - * be created at those keys. If the `keyPath` does not already contain a - * value, the `updater` function will be called with `notSetValue`, if - * provided, otherwise `undefined`. - * - * var data = Immutable.fromJS({ a: { b: { c: 10 } } }); - * data = data.updateIn(['a', 'b', 'c'], val => val * 2); - * // { a: { b: { c: 20 } } } - * - * If the `updater` function returns the same value it was called with, then - * no change will occur. This is still true if `notSetValue` is provided. - * - * var data1 = Immutable.fromJS({ a: { b: { c: 10 } } }); - * data2 = data1.updateIn(['x', 'y', 'z'], 100, val => val); - * assert(data2 === data1); - * - */ - updateIn( - keyPath: Array, - updater: (value: any) => any - ): Map; - updateIn( - keyPath: Array, - notSetValue: any, - updater: (value: any) => any - ): Map; - updateIn( - keyPath: Iterable, - updater: (value: any) => any - ): Map; - updateIn( - keyPath: Iterable, - notSetValue: any, - updater: (value: any) => any - ): Map; - - /** - * A combination of `updateIn` and `merge`, returning a new Map, but - * performing the merge at a point arrived at by following the keyPath. - * In other words, these two lines are equivalent: - * - * x.updateIn(['a', 'b', 'c'], abc => abc.merge(y)); - * x.mergeIn(['a', 'b', 'c'], y); - * - */ - mergeIn( - keyPath: Iterable, - ...iterables: Iterable[] - ): Map; - mergeIn( - keyPath: Array, - ...iterables: Iterable[] - ): Map; - mergeIn( - keyPath: Array, - ...iterables: {[key: string]: V}[] - ): Map; - - /** - * A combination of `updateIn` and `mergeDeep`, returning a new Map, but - * performing the deep merge at a point arrived at by following the keyPath. - * In other words, these two lines are equivalent: - * - * x.updateIn(['a', 'b', 'c'], abc => abc.mergeDeep(y)); - * x.mergeDeepIn(['a', 'b', 'c'], y); - * - */ - mergeDeepIn( - keyPath: Iterable, - ...iterables: Iterable[] - ): Map; - mergeDeepIn( - keyPath: Array, - ...iterables: Iterable[] - ): Map; - mergeDeepIn( - keyPath: Array, - ...iterables: {[key: string]: V}[] - ): Map; - - - // Transient changes - - /** - * Every time you call one of the above functions, a new immutable Map is - * created. If a pure function calls a number of these to produce a final - * return value, then a penalty on performance and memory has been paid by - * creating all of the intermediate immutable Maps. - * - * If you need to apply a series of mutations to produce a new immutable - * Map, `withMutations()` creates a temporary mutable copy of the Map which - * can apply mutations in a highly performant manner. In fact, this is - * exactly how complex mutations like `merge` are done. - * - * As an example, this results in the creation of 2, not 4, new Maps: - * - * var map1 = Immutable.Map(); - * var map2 = map1.withMutations(map => { - * map.set('a', 1).set('b', 2).set('c', 3); - * }); - * assert(map1.size === 0); - * assert(map2.size === 3); - * - */ - withMutations(mutator: (mutable: Map) => any): Map; - - /** - * Another way to avoid creation of intermediate Immutable maps is to create - * a mutable copy of this collection. Mutable copies *always* return `this`, - * and thus shouldn't be used for equality. Your function should never return - * a mutable copy of a collection, only use it internally to create a new - * collection. If possible, use `withMutations` as it provides an easier to - * use API. - * - * Note: if the collection is already mutable, `asMutable` returns itself. - */ - asMutable(): Map; - - /** - * The yin to `asMutable`'s yang. Because it applies to mutable collections, - * this operation is *mutable* and returns itself. Once performed, the mutable - * copy has become immutable and can be safely returned from a function. - */ - asImmutable(): Map; - } - - - /** - * A type of Map that has the additional guarantee that the iteration order of - * entries will be the order in which they were set(). - * - * The iteration behavior of OrderedMap is the same as native ES6 Map and - * JavaScript Object. - * - * Note that `OrderedMap` are more expensive than non-ordered `Map` and may - * consume more memory. `OrderedMap#set` is amortized O(log32 N), but not - * stable. - */ - - export module OrderedMap { - - /** - * True if the provided value is an OrderedMap. - */ - function isOrderedMap(maybeOrderedMap: any): boolean; - } - - /** - * Creates a new Immutable OrderedMap. - * - * Created with the same key value pairs as the provided KeyedIterable or - * JavaScript Object or expects an Iterable of [K, V] tuple entries. - * - * The iteration order of key-value pairs provided to this constructor will - * be preserved in the OrderedMap. - * - * var newOrderedMap = OrderedMap({key: "value"}); - * var newOrderedMap = OrderedMap([["key", "value"]]); - * - */ - export function OrderedMap(): OrderedMap; - export function OrderedMap(iter: KeyedIterable): OrderedMap; - export function OrderedMap(iter: Iterable>): OrderedMap; - export function OrderedMap(array: Array>): OrderedMap; - export function OrderedMap(obj: {[key: string]: V}): OrderedMap; - export function OrderedMap(iterator: Iterator>): OrderedMap; - export function OrderedMap(iterable: /*Iterable<[K,V]>*/Object): OrderedMap; - - export interface OrderedMap extends Map {} - - - /** - * A Collection of unique values with `O(log32 N)` adds and has. - * - * When iterating a Set, the entries will be (value, value) pairs. Iteration - * order of a Set is undefined, however is stable. Multiple iterations of the - * same Set will iterate in the same order. - * - * Set values, like Map keys, may be of any type. Equality is determined using - * `Immutable.is`, enabling Sets to uniquely include other Immutable - * collections, custom value types, and NaN. - */ - export module Set { - - /** - * True if the provided value is a Set - */ - function isSet(maybeSet: any): boolean; - - /** - * Creates a new Set containing `values`. - */ - function of(...values: T[]): Set; - - /** - * `Set.fromKeys()` creates a new immutable Set containing the keys from - * this Iterable or JavaScript Object. - */ - function fromKeys(iter: Iterable): Set; - function fromKeys(obj: {[key: string]: any}): Set; - } - - /** - * Create a new immutable Set containing the values of the provided - * iterable-like. - */ - export function Set(): Set; - export function Set(iter: SetIterable): Set; - export function Set(iter: IndexedIterable): Set; - export function Set(iter: KeyedIterable): Set; - export function Set(array: Array): Set; - export function Set(iterator: Iterator): Set; - export function Set(iterable: /*Iterable*/Object): Set; - - export interface Set extends SetCollection { - - // Persistent changes - - /** - * Returns a new Set which also includes this value. - */ - add(value: T): Set; - - /** - * Returns a new Set which excludes this value. - * - * Note: `delete` cannot be safely used in IE8 - * @alias remove - */ - delete(value: T): Set; - remove(value: T): Set; - - /** - * Returns a new Set containing no values. - */ - clear(): Set; - - /** - * Returns a Set including any value from `iterables` that does not already - * exist in this Set. - * @alias merge - */ - union(...iterables: Iterable[]): Set; - union(...iterables: Array[]): Set; - merge(...iterables: Iterable[]): Set; - merge(...iterables: Array[]): Set; - - - /** - * Returns a Set which has removed any values not also contained - * within `iterables`. - */ - intersect(...iterables: Iterable[]): Set; - intersect(...iterables: Array[]): Set; - - /** - * Returns a Set excluding any values contained within `iterables`. - */ - subtract(...iterables: Iterable[]): Set; - subtract(...iterables: Array[]): Set; - - - // Transient changes - - /** - * @see `Map#withMutations` - */ - withMutations(mutator: (mutable: Set) => any): Set; - - /** - * @see `Map#asMutable` - */ - asMutable(): Set; - - /** - * @see `Map#asImmutable` - */ - asImmutable(): Set; - } - - - /** - * A type of Set that has the additional guarantee that the iteration order of - * values will be the order in which they were `add`ed. - * - * The iteration behavior of OrderedSet is the same as native ES6 Set. - * - * Note that `OrderedSet` are more expensive than non-ordered `Set` and may - * consume more memory. `OrderedSet#add` is amortized O(log32 N), but not - * stable. - */ - export module OrderedSet { - - /** - * True if the provided value is an OrderedSet. - */ - function isOrderedSet(maybeOrderedSet: any): boolean; - - /** - * Creates a new OrderedSet containing `values`. - */ - function of(...values: T[]): OrderedSet; - - /** - * `OrderedSet.fromKeys()` creates a new immutable OrderedSet containing - * the keys from this Iterable or JavaScript Object. - */ - function fromKeys(iter: Iterable): OrderedSet; - function fromKeys(obj: {[key: string]: any}): OrderedSet; - } - - /** - * Create a new immutable OrderedSet containing the values of the provided - * iterable-like. - */ - export function OrderedSet(): OrderedSet; - export function OrderedSet(iter: SetIterable): OrderedSet; - export function OrderedSet(iter: IndexedIterable): OrderedSet; - export function OrderedSet(iter: KeyedIterable): OrderedSet; - export function OrderedSet(array: Array): OrderedSet; - export function OrderedSet(iterator: Iterator): OrderedSet; - export function OrderedSet(iterable: /*Iterable*/Object): OrderedSet; - - export interface OrderedSet extends Set {} - - - /** - * Stacks are indexed collections which support very efficient O(1) addition - * and removal from the front using `unshift(v)` and `shift()`. - * - * For familiarity, Stack also provides `push(v)`, `pop()`, and `peek()`, but - * be aware that they also operate on the front of the list, unlike List or - * a JavaScript Array. - * - * Note: `reverse()` or any inherent reverse traversal (`reduceRight`, - * `lastIndexOf`, etc.) is not efficient with a Stack. - * - * Stack is implemented with a Single-Linked List. - */ - export module Stack { - - /** - * True if the provided value is a Stack - */ - function isStack(maybeStack: any): boolean; - - /** - * Creates a new Stack containing `values`. - */ - function of(...values: T[]): Stack; - } - - /** - * Create a new immutable Stack containing the values of the provided - * iterable-like. - * - * The iteration order of the provided iterable is preserved in the - * resulting `Stack`. - */ - export function Stack(): Stack; - export function Stack(iter: IndexedIterable): Stack; - export function Stack(iter: SetIterable): Stack; - export function Stack(iter: KeyedIterable): Stack; - export function Stack(array: Array): Stack; - export function Stack(iterator: Iterator): Stack; - export function Stack(iterable: /*Iterable*/Object): Stack; - - export interface Stack extends IndexedCollection { - - // Reading values - - /** - * Alias for `Stack.first()`. - */ - peek(): T; - - - // Persistent changes - - /** - * Returns a new Stack with 0 size and no values. - */ - clear(): Stack; - - /** - * Returns a new Stack with the provided `values` prepended, shifting other - * values ahead to higher indices. - * - * This is very efficient for Stack. - */ - unshift(...values: T[]): Stack; - - /** - * Like `Stack#unshift`, but accepts a iterable rather than varargs. - */ - unshiftAll(iter: Iterable): Stack; - unshiftAll(iter: Array): Stack; - - /** - * Returns a new Stack with a size ones less than this Stack, excluding - * the first item in this Stack, shifting all other values to a lower index. - * - * Note: this differs from `Array#shift` because it returns a new - * Stack rather than the removed value. Use `first()` or `peek()` to get the - * first value in this Stack. - */ - shift(): Stack; - - /** - * Alias for `Stack#unshift` and is not equivalent to `List#push`. - */ - push(...values: T[]): Stack; - - /** - * Alias for `Stack#unshiftAll`. - */ - pushAll(iter: Iterable): Stack; - pushAll(iter: Array): Stack; - - /** - * Alias for `Stack#shift` and is not equivalent to `List#pop`. - */ - pop(): Stack; - - - // Transient changes - - /** - * @see `Map#withMutations` - */ - withMutations(mutator: (mutable: Stack) => any): Stack; - - /** - * @see `Map#asMutable` - */ - asMutable(): Stack; - - /** - * @see `Map#asImmutable` - */ - asImmutable(): Stack; - } - - - /** - * Returns a IndexedSeq of numbers from `start` (inclusive) to `end` - * (exclusive), by `step`, where `start` defaults to 0, `step` to 1, and `end` to - * infinity. When `start` is equal to `end`, returns empty range. - * - * Range() // [0,1,2,3,...] - * Range(10) // [10,11,12,13,...] - * Range(10,15) // [10,11,12,13,14] - * Range(10,30,5) // [10,15,20,25] - * Range(30,10,5) // [30,25,20,15] - * Range(30,30,5) // [] - * - */ - export function Range(start?: number, end?: number, step?: number): IndexedSeq; - - - /** - * Returns a IndexedSeq of `value` repeated `times` times. When `times` is - * not defined, returns an infinite `Seq` of `value`. - * - * Repeat('foo') // ['foo','foo','foo',...] - * Repeat('bar',4) // ['bar','bar','bar','bar'] - * - */ - export function Repeat(value: T, times?: number): IndexedSeq; - - - /** - * Creates a new Class which produces Record instances. A record is similar to - * a JS object, but enforce a specific set of allowed string keys, and have - * default values. - * - * var ABRecord = Record({a:1, b:2}) - * var myRecord = new ABRecord({b:3}) - * - * Records always have a value for the keys they define. `remove`ing a key - * from a record simply resets it to the default value for that key. - * - * myRecord.size // 2 - * myRecord.get('a') // 1 - * myRecord.get('b') // 3 - * myRecordWithoutB = myRecord.remove('b') - * myRecordWithoutB.get('b') // 2 - * myRecordWithoutB.size // 2 - * - * Values provided to the constructor not found in the Record type will - * be ignored: - * - * var myRecord = new ABRecord({b:3, x:10}) - * myRecord.get('x') // undefined - * - * Because Records have a known set of string keys, property get access works - * as expected, however property sets will throw an Error. - * - * Note: IE8 does not support property access. Only use `get()` when - * supporting IE8. - * - * myRecord.b // 3 - * myRecord.b = 5 // throws Error - * - * Record Classes can be extended as well, allowing for custom methods on your - * Record. This is not a common pattern in functional environments, but is in - * many JS programs. - * - * Note: TypeScript does not support this type of subclassing. - * - * class ABRecord extends Record({a:1,b:2}) { - * getAB() { - * return this.a + this.b; - * } - * } - * - * var myRecord = new ABRecord(b:3) - * myRecord.getAB() // 4 - * - */ - export module Record { - interface Class { - new (): Map; - new (values: {[key: string]: any}): Map; - new (values: Iterable): Map; // deprecated - - (): Map; - (values: {[key: string]: any}): Map; - (values: Iterable): Map; // deprecated - } - } - - export function Record( - defaultValues: {[key: string]: any}, name?: string - ): Record.Class; - - - /** - * Represents a sequence of values, but may not be backed by a concrete data - * structure. - * - * **Seq is immutable** — Once a Seq is created, it cannot be - * changed, appended to, rearranged or otherwise modified. Instead, any - * mutative method called on a `Seq` will return a new `Seq`. - * - * **Seq is lazy** — Seq does as little work as necessary to respond to any - * method call. Values are often created during iteration, including implicit - * iteration when reducing or converting to a concrete data structure such as - * a `List` or JavaScript `Array`. - * - * For example, the following performs no work, because the resulting - * Seq's values are never iterated: - * - * var oddSquares = Immutable.Seq.of(1,2,3,4,5,6,7,8) - * .filter(x => x % 2).map(x => x * x); - * - * Once the Seq is used, it performs only the work necessary. In this - * example, no intermediate data structures are ever created, filter is only - * called three times, and map is only called twice: - * - * console.log(evenSquares.get(1)); // 9 - * - * Seq allows for the efficient chaining of operations, - * allowing for the expression of logic that can otherwise be very tedious: - * - * Immutable.Seq({a:1, b:1, c:1}) - * .flip().map(key => key.toUpperCase()).flip().toObject(); - * // Map { A: 1, B: 1, C: 1 } - * - * As well as expressing logic that would otherwise be memory or time limited: - * - * Immutable.Range(1, Infinity) - * .skip(1000) - * .map(n => -n) - * .filter(n => n % 2 === 0) - * .take(2) - * .reduce((r, n) => r * n, 1); - * // 1006008 - * - * Seq is often used to provide a rich collection API to JavaScript Object. - * - * Immutable.Seq({ x: 0, y: 1, z: 2 }).map(v => v * 2).toObject(); - * // { x: 0, y: 2, z: 4 } - */ - - export module Seq { - /** - * True if `maybeSeq` is a Seq, it is not backed by a concrete - * structure such as Map, List, or Set. - */ - function isSeq(maybeSeq: any): boolean; - - /** - * Returns a Seq of the values provided. Alias for `IndexedSeq.of()`. - */ - function of(...values: T[]): IndexedSeq; - } - - /** - * Creates a Seq. - * - * Returns a particular kind of `Seq` based on the input. - * - * * If a `Seq`, that same `Seq`. - * * If an `Iterable`, a `Seq` of the same kind (Keyed, Indexed, or Set). - * * If an Array-like, an `IndexedSeq`. - * * If an Object with an Iterator, an `IndexedSeq`. - * * If an Iterator, an `IndexedSeq`. - * * If an Object, a `KeyedSeq`. - * - */ - export function Seq(): Seq; - export function Seq(seq: Seq): Seq; - export function Seq(iterable: Iterable): Seq; - export function Seq(array: Array): IndexedSeq; - export function Seq(obj: {[key: string]: V}): KeyedSeq; - export function Seq(iterator: Iterator): IndexedSeq; - export function Seq(iterable: /*ES6Iterable*/Object): IndexedSeq; - - export interface Seq extends Iterable { - - /** - * Some Seqs can describe their size lazily. When this is the case, - * size will be an integer. Otherwise it will be undefined. - * - * For example, Seqs returned from `map()` or `reverse()` - * preserve the size of the original `Seq` while `filter()` does not. - * - * Note: `Range`, `Repeat` and `Seq`s made from `Array`s and `Object`s will - * always have a size. - */ - size: number/*?*/; - - - // Force evaluation - - /** - * Because Sequences are lazy and designed to be chained together, they do - * not cache their results. For example, this map function is called a total - * of 6 times, as each `join` iterates the Seq of three values. - * - * var squares = Seq.of(1,2,3).map(x => x * x); - * squares.join() + squares.join(); - * - * If you know a `Seq` will be used multiple times, it may be more - * efficient to first cache it in memory. Here, the map function is called - * only 3 times. - * - * var squares = Seq.of(1,2,3).map(x => x * x).cacheResult(); - * squares.join() + squares.join(); - * - * Use this method judiciously, as it must fully evaluate a Seq which can be - * a burden on memory and possibly performance. - * - * Note: after calling `cacheResult`, a Seq will always have a `size`. - */ - cacheResult(): /*this*/Seq; - } - - - /** - * `Seq` which represents key-value pairs. - */ - export module KeyedSeq {} - - /** - * Always returns a KeyedSeq, if input is not keyed, expects an - * iterable of [K, V] tuples. - */ - export function KeyedSeq(): KeyedSeq; - export function KeyedSeq(seq: KeyedIterable): KeyedSeq; - export function KeyedSeq(seq: Iterable): KeyedSeq; - export function KeyedSeq(array: Array): KeyedSeq; - export function KeyedSeq(obj: {[key: string]: V}): KeyedSeq; - export function KeyedSeq(iterator: Iterator): KeyedSeq; - export function KeyedSeq(iterable: /*Iterable<[K,V]>*/Object): KeyedSeq; - - export interface KeyedSeq extends Seq, KeyedIterable { - - /** - * Returns itself - */ - toSeq(): /*this*/KeyedSeq - } - - - /** - * `Seq` which represents an ordered indexed list of values. - */ - export module IndexedSeq { - - /** - * Provides an IndexedSeq of the values provided. - */ - function of(...values: T[]): IndexedSeq; - } - - /** - * Always returns IndexedSeq, discarding associated keys and - * supplying incrementing indices. - */ - export function IndexedSeq(): IndexedSeq; - export function IndexedSeq(seq: IndexedIterable): IndexedSeq; - export function IndexedSeq(seq: SetIterable): IndexedSeq; - export function IndexedSeq(seq: KeyedIterable): IndexedSeq; - export function IndexedSeq(array: Array): IndexedSeq; - export function IndexedSeq(iterator: Iterator): IndexedSeq; - export function IndexedSeq(iterable: /*Iterable*/Object): IndexedSeq; - - export interface IndexedSeq extends Seq, IndexedIterable { - - /** - * Returns itself - */ - toSeq(): /*this*/IndexedSeq - } - - /** - * `Seq` which represents a set of values. - * - * Because `Seq` are often lazy, `SetSeq` does not provide the same guarantee - * of value uniqueness as the concrete `Set`. - */ - export module SetSeq { - - /** - * Returns a SetSeq of the provided values - */ - function of(...values: T[]): SetSeq; - } - - /** - * Always returns a SetSeq, discarding associated indices or keys. - */ - export function SetSeq(): SetSeq; - export function SetSeq(seq: SetIterable): SetSeq; - export function SetSeq(seq: IndexedIterable): SetSeq; - export function SetSeq(seq: KeyedIterable): SetSeq; - export function SetSeq(array: Array): SetSeq; - export function SetSeq(iterator: Iterator): SetSeq; - export function SetSeq(iterable: /*Iterable*/Object): SetSeq; - - export interface SetSeq extends Seq, SetIterable { - - /** - * Returns itself - */ - toSeq(): /*this*/SetSeq - } - - - /** - * The `Iterable` is a set of (key, value) entries which can be iterated, and - * is the base class for all collections in `immutable`, allowing them to - * make use of all the Iterable methods (such as `map` and `filter`). - * - * Note: An iterable is always iterated in the same order, however that order - * may not always be well defined, as is the case for the `Map` and `Set`. - */ - export module Iterable { - /** - * True if `maybeIterable` is an Iterable, or any of its subclasses. - */ - function isIterable(maybeIterable: any): boolean; - - /** - * True if `maybeKeyed` is a KeyedIterable, or any of its subclasses. - */ - function isKeyed(maybeKeyed: any): boolean; - - /** - * True if `maybeIndexed` is a IndexedIterable, or any of its subclasses. - */ - function isIndexed(maybeIndexed: any): boolean; - - /** - * True if `maybeAssociative` is either a keyed or indexed Iterable. - */ - function isAssociative(maybeAssociative: any): boolean; - - /** - * True if `maybeOrdered` is an Iterable where iteration order is well - * defined. True for IndexedIterable as well as OrderedMap and OrderedSet. - */ - function isOrdered(maybeOrdered: any): boolean; - } - - /** - * Creates an Iterable. - * - * The type of Iterable created is based on the input. - * - * * If an `Iterable`, that same `Iterable`. - * * If an Array-like, an `IndexedIterable`. - * * If an Object with an Iterator, an `IndexedIterable`. - * * If an Iterator, an `IndexedIterable`. - * * If an Object, a `KeyedIterable`. - * - * This methods forces the conversion of Objects and Strings to Iterables. - * If you want to ensure that a Iterable of one item is returned, use - * `Seq.of`. - */ - export function Iterable(iterable: Iterable): Iterable; - export function Iterable(array: Array): IndexedIterable; - export function Iterable(obj: {[key: string]: V}): KeyedIterable; - export function Iterable(iterator: Iterator): IndexedIterable; - export function Iterable(iterable: /*ES6Iterable*/Object): IndexedIterable; - export function Iterable(value: V): IndexedIterable; - - export interface Iterable { - - // Value equality - - /** - * True if this and the other Iterable have value equality, as defined - * by `Immutable.is()`. - * - * Note: This is equivalent to `Immutable.is(this, other)`, but provided to - * allow for chained expressions. - */ - equals(other: Iterable): boolean; - - /** - * Computes and returns the hashed identity for this Iterable. - * - * The `hashCode` of an Iterable is used to determine potential equality, - * and is used when adding this to a `Set` or as a key in a `Map`, enabling - * lookup via a different instance. - * - * var a = List.of(1, 2, 3); - * var b = List.of(1, 2, 3); - * assert(a !== b); // different instances - * var set = Set.of(a); - * assert(set.has(b) === true); - * - * If two values have the same `hashCode`, they are [not guaranteed - * to be equal][Hash Collision]. If two values have different `hashCode`s, - * they must not be equal. - * - * [Hash Collision]: http://en.wikipedia.org/wiki/Collision_(computer_science) - */ - hashCode(): number; - - - // Reading values - - /** - * Returns the value associated with the provided key, or notSetValue if - * the Iterable does not contain this key. - * - * Note: it is possible a key may be associated with an `undefined` value, - * so if `notSetValue` is not provided and this method returns `undefined`, - * that does not guarantee the key was not found. - */ - get(key: K, notSetValue?: V): V; - - /** - * True if a key exists within this `Iterable`. - */ - has(key: K): boolean; - - /** - * True if a value exists within this `Iterable`. - * @alias contains - */ - includes(value: V): boolean; - contains(value: V): boolean; - - /** - * The first value in the Iterable. - */ - first(): V; - - /** - * The last value in the Iterable. - */ - last(): V; - - - // Reading deep values - - /** - * Returns the value found by following a path of keys or indices through - * nested Iterables. - */ - getIn(searchKeyPath: Array, notSetValue?: any): any; - getIn(searchKeyPath: Iterable, notSetValue?: any): any; - - /** - * True if the result of following a path of keys or indices through nested - * Iterables results in a set value. - */ - hasIn(searchKeyPath: Array): boolean; - hasIn(searchKeyPath: Iterable): boolean; - - - // Conversion to JavaScript types - - /** - * Deeply converts this Iterable to equivalent JS. - * - * `IndexedIterables`, and `SetIterables` become Arrays, while - * `KeyedIterables` become Objects. - * - * @alias toJSON - */ - toJS(): any; - - /** - * Shallowly converts this iterable to an Array, discarding keys. - */ - toArray(): Array; - - /** - * Shallowly converts this Iterable to an Object. - * - * Throws if keys are not strings. - */ - toObject(): { [key: string]: V }; - - - // Conversion to Collections - - /** - * Converts this Iterable to a Map, Throws if keys are not hashable. - * - * Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided - * for convenience and to allow for chained expressions. - */ - toMap(): Map; - - /** - * Converts this Iterable to a Map, maintaining the order of iteration. - * - * Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but - * provided for convenience and to allow for chained expressions. - */ - toOrderedMap(): Map; - - /** - * Converts this Iterable to a Set, discarding keys. Throws if values - * are not hashable. - * - * Note: This is equivalent to `Set(this)`, but provided to allow for - * chained expressions. - */ - toSet(): Set; - - /** - * Converts this Iterable to a Set, maintaining the order of iteration and - * discarding keys. - * - * Note: This is equivalent to `OrderedSet(this.valueSeq())`, but provided - * for convenience and to allow for chained expressions. - */ - toOrderedSet(): Set; - - /** - * Converts this Iterable to a List, discarding keys. - * - * Note: This is equivalent to `List(this)`, but provided to allow - * for chained expressions. - */ - toList(): List; - - /** - * Converts this Iterable to a Stack, discarding keys. Throws if values - * are not hashable. - * - * Note: This is equivalent to `Stack(this)`, but provided to allow for - * chained expressions. - */ - toStack(): Stack; - - - // Conversion to Seq - - /** - * Converts this Iterable to a Seq of the same kind (indexed, - * keyed, or set). - */ - toSeq(): Seq; - - /** - * Returns a KeyedSeq from this Iterable where indices are treated as keys. - * - * This is useful if you want to operate on an - * IndexedIterable and preserve the [index, value] pairs. - * - * The returned Seq will have identical iteration order as - * this Iterable. - * - * Example: - * - * var indexedSeq = Immutable.Seq.of('A', 'B', 'C'); - * indexedSeq.filter(v => v === 'B').toString() // Seq [ 'B' ] - * var keyedSeq = indexedSeq.toKeyedSeq(); - * keyedSeq.filter(v => v === 'B').toString() // Seq { 1: 'B' } - * - */ - toKeyedSeq(): KeyedSeq; - - /** - * Returns an IndexedSeq of the values of this Iterable, discarding keys. - */ - toIndexedSeq(): IndexedSeq; - - /** - * Returns a SetSeq of the values of this Iterable, discarding keys. - */ - toSetSeq(): SetSeq; - - - // Iterators - - /** - * An iterator of this `Iterable`'s keys. - */ - keys(): Iterator; - - /** - * An iterator of this `Iterable`'s values. - */ - values(): Iterator; - - /** - * An iterator of this `Iterable`'s entries as `[key, value]` tuples. - */ - entries(): Iterator>; - - - // Iterables (Seq) - - /** - * Returns a new IndexedSeq of the keys of this Iterable, - * discarding values. - */ - keySeq(): IndexedSeq; - - /** - * Returns an IndexedSeq of the values of this Iterable, discarding keys. - */ - valueSeq(): IndexedSeq; - - /** - * Returns a new IndexedSeq of [key, value] tuples. - */ - entrySeq(): IndexedSeq>; - - - // Sequence algorithms - - /** - * Returns a new Iterable of the same type with values passed through a - * `mapper` function. - * - * Seq({ a: 1, b: 2 }).map(x => 10 * x) - * // Seq { a: 10, b: 20 } - * - */ - map( - mapper: (value?: V, key?: K, iter?: /*this*/Iterable) => M, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type with only the entries for which - * the `predicate` function returns true. - * - * Seq({a:1,b:2,c:3,d:4}).filter(x => x % 2 === 0) - * // Seq { b: 2, d: 4 } - * - */ - filter( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type with only the entries for which - * the `predicate` function returns false. - * - * Seq({a:1,b:2,c:3,d:4}).filterNot(x => x % 2 === 0) - * // Seq { a: 1, c: 3 } - * - */ - filterNot( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type in reverse order. - */ - reverse(): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes the same entries, - * stably sorted by using a `comparator`. - * - * If a `comparator` is not provided, a default comparator uses `<` and `>`. - * - * `comparator(valueA, valueB)`: - * - * * Returns `0` if the elements should not be swapped. - * * Returns `-1` (or any negative number) if `valueA` comes before `valueB` - * * Returns `1` (or any positive number) if `valueA` comes after `valueB` - * * Is pure, i.e. it must always return the same value for the same pair - * of values. - * - * When sorting collections which have no defined order, their ordered - * equivalents will be returned. e.g. `map.sort()` returns OrderedMap. - */ - sort(comparator?: (valueA: V, valueB: V) => number): /*this*/Iterable; - - /** - * Like `sort`, but also accepts a `comparatorValueMapper` which allows for - * sorting by more sophisticated means: - * - * hitters.sortBy(hitter => hitter.avgHits); - * - */ - sortBy( - comparatorValueMapper: (value?: V, key?: K, iter?: /*this*/Iterable) => C, - comparator?: (valueA: C, valueB: C) => number - ): /*this*/Iterable; - - /** - * Returns a `KeyedIterable` of `KeyedIterables`, grouped by the return - * value of the `grouper` function. - * - * Note: This is always an eager operation. - */ - groupBy( - grouper: (value?: V, key?: K, iter?: /*this*/Iterable) => G, - context?: any - ): /*Map*/KeyedSeq>; - - - // Side effects - - /** - * The `sideEffect` is executed for every entry in the Iterable. - * - * Unlike `Array#forEach`, if any call of `sideEffect` returns - * `false`, the iteration will stop. Returns the number of entries iterated - * (including the last iteration which returned false). - */ - forEach( - sideEffect: (value?: V, key?: K, iter?: /*this*/Iterable) => any, - context?: any - ): number; - - - // Creating subsets - - /** - * Returns a new Iterable of the same type representing a portion of this - * Iterable from start up to but not including end. - * - * If begin is negative, it is offset from the end of the Iterable. e.g. - * `slice(-2)` returns a Iterable of the last two entries. If it is not - * provided the new Iterable will begin at the beginning of this Iterable. - * - * If end is negative, it is offset from the end of the Iterable. e.g. - * `slice(0, -1)` returns an Iterable of everything but the last entry. If - * it is not provided, the new Iterable will continue through the end of - * this Iterable. - * - * If the requested slice is equivalent to the current Iterable, then it - * will return itself. - */ - slice(begin?: number, end?: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type containing all entries except - * the first. - */ - rest(): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type containing all entries except - * the last. - */ - butLast(): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which excludes the first `amount` - * entries from this Iterable. - */ - skip(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which excludes the last `amount` - * entries from this Iterable. - */ - skipLast(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries starting - * from when `predicate` first returns false. - * - * Seq.of('dog','frog','cat','hat','god') - * .skipWhile(x => x.match(/g/)) - * // Seq [ 'cat', 'hat', 'god' ] - * - */ - skipWhile( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries starting - * from when `predicate` first returns true. - * - * Seq.of('dog','frog','cat','hat','god') - * .skipUntil(x => x.match(/hat/)) - * // Seq [ 'hat', 'god' ] - * - */ - skipUntil( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes the first `amount` - * entries from this Iterable. - */ - take(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes the last `amount` - * entries from this Iterable. - */ - takeLast(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries from this - * Iterable as long as the `predicate` returns true. - * - * Seq.of('dog','frog','cat','hat','god') - * .takeWhile(x => x.match(/o/)) - * // Seq [ 'dog', 'frog' ] - * - */ - takeWhile( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries from this - * Iterable as long as the `predicate` returns false. - * - * Seq.of('dog','frog','cat','hat','god').takeUntil(x => x.match(/at/)) - * // ['dog', 'frog'] - * - */ - takeUntil( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - - // Combination - - /** - * Returns a new Iterable of the same type with other values and - * iterable-like concatenated to this one. - * - * For Seqs, all entries will be present in - * the resulting iterable, even if they have the same key. - */ - concat(...valuesOrIterables: /*Array|V*/any[]): /*this*/Iterable; - - /** - * Flattens nested Iterables. - * - * Will deeply flatten the Iterable by default, returning an Iterable of the - * same type, but a `depth` can be provided in the form of a number or - * boolean (where true means to shallowly flatten one level). A depth of 0 - * (or shallow: false) will deeply flatten. - * - * Flattens only others Iterable, not Arrays or Objects. - * - * Note: `flatten(true)` operates on Iterable> and - * returns Iterable - */ - flatten(depth?: number): /*this*/Iterable; - flatten(shallow?: boolean): /*this*/Iterable; - - /** - * Flat-maps the Iterable, returning an Iterable of the same type. - * - * Similar to `iter.map(...).flatten(true)`. - */ - flatMap( - mapper: (value?: V, key?: K, iter?: /*this*/Iterable) => Iterable, - context?: any - ): /*this*/Iterable; - flatMap( - mapper: (value?: V, key?: K, iter?: /*this*/Iterable) => /*iterable-like*/any, - context?: any - ): /*this*/Iterable; - - - // Reducing a value - - /** - * Reduces the Iterable to a value by calling the `reducer` for every entry - * in the Iterable and passing along the reduced value. - * - * If `initialReduction` is not provided, or is null, the first item in the - * Iterable will be used. - * - * @see `Array#reduce`. - */ - reduce( - reducer: (reduction?: R, value?: V, key?: K, iter?: /*this*/Iterable) => R, - initialReduction?: R, - context?: any - ): R; - - /** - * Reduces the Iterable in reverse (from the right side). - * - * Note: Similar to this.reverse().reduce(), and provided for parity - * with `Array#reduceRight`. - */ - reduceRight( - reducer: (reduction?: R, value?: V, key?: K, iter?: /*this*/Iterable) => R, - initialReduction?: R, - context?: any - ): R; - - /** - * True if `predicate` returns true for all entries in the Iterable. - */ - every( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): boolean; - - /** - * True if `predicate` returns true for any entry in the Iterable. - */ - some( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): boolean; - - /** - * Joins values together as a string, inserting a separator between each. - * The default separator is `","`. - */ - join(separator?: string): string; - - /** - * Returns true if this Iterable includes no values. - * - * For some lazy `Seq`, `isEmpty` might need to iterate to determine - * emptiness. At most one iteration will occur. - */ - isEmpty(): boolean; - - /** - * Returns the size of this Iterable. - * - * Regardless of if this Iterable can describe its size lazily (some Seqs - * cannot), this method will always return the correct size. E.g. it - * evaluates a lazy `Seq` if necessary. - * - * If `predicate` is provided, then this returns the count of entries in the - * Iterable for which the `predicate` returns true. - */ - count(): number; - count( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): number; - - /** - * Returns a `KeyedSeq` of counts, grouped by the return value of - * the `grouper` function. - * - * Note: This is not a lazy operation. - */ - countBy( - grouper: (value?: V, key?: K, iter?: /*this*/Iterable) => G, - context?: any - ): Map; - - - // Search for value - - /** - * Returns the value for which the `predicate` returns true. - */ - find( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): V; - - /** - * Returns the last value for which the `predicate` returns true. - * - * Note: `predicate` will be called for each entry in reverse. - */ - findLast( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): V; - - /** - * Returns the [key, value] entry for which the `predicate` returns true. - */ - findEntry( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): /*[K, V]*/Array; - - /** - * Returns the last [key, value] entry for which the `predicate` - * returns true. - * - * Note: `predicate` will be called for each entry in reverse. - */ - findLastEntry( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): /*[K, V]*/Array; - - /** - * Returns the maximum value in this collection. If any values are - * comparatively equivalent, the first one found will be returned. - * - * The `comparator` is used in the same way as `Iterable#sort`. If it is not - * provided, the default comparator is `>`. - * - * When two values are considered equivalent, the first encountered will be - * returned. Otherwise, `max` will operate independent of the order of input - * as long as the comparator is commutative. The default comparator `>` is - * commutative *only* when types do not differ. - * - * If `comparator` returns 0 and either value is NaN, undefined, or null, - * that value will be returned. - */ - max(comparator?: (valueA: V, valueB: V) => number): V; - - /** - * Like `max`, but also accepts a `comparatorValueMapper` which allows for - * comparing by more sophisticated means: - * - * hitters.maxBy(hitter => hitter.avgHits); - * - */ - maxBy( - comparatorValueMapper: (value?: V, key?: K, iter?: /*this*/Iterable) => C, - comparator?: (valueA: C, valueB: C) => number - ): V; - - /** - * Returns the minimum value in this collection. If any values are - * comparatively equivalent, the first one found will be returned. - * - * The `comparator` is used in the same way as `Iterable#sort`. If it is not - * provided, the default comparator is `<`. - * - * When two values are considered equivalent, the first encountered will be - * returned. Otherwise, `min` will operate independent of the order of input - * as long as the comparator is commutative. The default comparator `<` is - * commutative *only* when types do not differ. - * - * If `comparator` returns 0 and either value is NaN, undefined, or null, - * that value will be returned. - */ - min(comparator?: (valueA: V, valueB: V) => number): V; - - /** - * Like `min`, but also accepts a `comparatorValueMapper` which allows for - * comparing by more sophisticated means: - * - * hitters.minBy(hitter => hitter.avgHits); - * - */ - minBy( - comparatorValueMapper: (value?: V, key?: K, iter?: /*this*/Iterable) => C, - comparator?: (valueA: C, valueB: C) => number - ): V; - - - // Comparison - - /** - * True if `iter` includes every value in this Iterable. - */ - isSubset(iter: Iterable): boolean; - isSubset(iter: Array): boolean; - - /** - * True if this Iterable includes every value in `iter`. - */ - isSuperset(iter: Iterable): boolean; - isSuperset(iter: Array): boolean; - - - /** - * Note: this is here as a convenience to work around an issue with - * TypeScript https://github.com/Microsoft/TypeScript/issues/285, but - * Iterable does not define `size`, instead `Seq` defines `size` as - * nullable number, and `Collection` defines `size` as always a number. - * - * @ignore - */ - size: number; - } - - - /** - * Keyed Iterables have discrete keys tied to each value. - * - * When iterating `KeyedIterable`, each iteration will yield a `[K, V]` tuple, - * in other words, `Iterable#entries` is the default iterator for Keyed - * Iterables. - */ - export module KeyedIterable {} - - /** - * Creates a KeyedIterable - * - * Similar to `Iterable()`, however it expects iterable-likes of [K, V] - * tuples if not constructed from a KeyedIterable or JS Object. - */ - export function KeyedIterable(iter: KeyedIterable): KeyedIterable; - export function KeyedIterable(iter: Iterable): KeyedIterable; - export function KeyedIterable(array: Array): KeyedIterable; - export function KeyedIterable(obj: {[key: string]: V}): KeyedIterable; - export function KeyedIterable(iterator: Iterator): KeyedIterable; - export function KeyedIterable(iterable: /*Iterable<[K,V]>*/Object): KeyedIterable; - - export interface KeyedIterable extends Iterable { - - /** - * Returns KeyedSeq. - * @override - */ - toSeq(): KeyedSeq; - - - // Sequence functions - - /** - * Returns a new KeyedIterable of the same type where the keys and values - * have been flipped. - * - * Seq({ a: 'z', b: 'y' }).flip() // { z: 'a', y: 'b' } - * - */ - flip(): /*this*/KeyedIterable; - - /** - * Returns a new KeyedIterable of the same type with keys passed through a - * `mapper` function. - * - * Seq({ a: 1, b: 2 }) - * .mapKeys(x => x.toUpperCase()) - * // Seq { A: 1, B: 2 } - * - */ - mapKeys( - mapper: (key?: K, value?: V, iter?: /*this*/KeyedIterable) => M, - context?: any - ): /*this*/KeyedIterable; - - /** - * Returns a new KeyedIterable of the same type with entries - * ([key, value] tuples) passed through a `mapper` function. - * - * Seq({ a: 1, b: 2 }) - * .mapEntries(([k, v]) => [k.toUpperCase(), v * 2]) - * // Seq { A: 2, B: 4 } - * - */ - mapEntries( - mapper: ( - entry?: /*(K, V)*/Array, - index?: number, - iter?: /*this*/KeyedIterable - ) => /*[KM, VM]*/Array, - context?: any - ): /*this*/KeyedIterable; - - - // Search for value - - /** - * Returns the key associated with the search value, or undefined. - */ - keyOf(searchValue: V): K; - - /** - * Returns the last key associated with the search value, or undefined. - */ - lastKeyOf(searchValue: V): K; - - /** - * Returns the key for which the `predicate` returns true. - */ - findKey( - predicate: (value?: V, key?: K, iter?: /*this*/KeyedIterable) => boolean, - context?: any - ): K; - - /** - * Returns the last key for which the `predicate` returns true. - * - * Note: `predicate` will be called for each entry in reverse. - */ - findLastKey( - predicate: (value?: V, key?: K, iter?: /*this*/KeyedIterable) => boolean, - context?: any - ): K; - } - - - /** - * Indexed Iterables have incrementing numeric keys. They exhibit - * slightly different behavior than `KeyedIterable` for some methods in order - * to better mirror the behavior of JavaScript's `Array`, and add methods - * which do not make sense on non-indexed Iterables such as `indexOf`. - * - * Unlike JavaScript arrays, `IndexedIterable`s are always dense. "Unset" - * indices and `undefined` indices are indistinguishable, and all indices from - * 0 to `size` are visited when iterated. - * - * All IndexedIterable methods return re-indexed Iterables. In other words, - * indices always start at 0 and increment until size. If you wish to - * preserve indices, using them as keys, convert to a KeyedIterable by calling - * `toKeyedSeq`. - */ - export module IndexedIterable {} - - /** - * Creates a new IndexedIterable. - */ - export function IndexedIterable(iter: IndexedIterable): IndexedIterable; - export function IndexedIterable(iter: SetIterable): IndexedIterable; - export function IndexedIterable(iter: KeyedIterable): IndexedIterable; - export function IndexedIterable(array: Array): IndexedIterable; - export function IndexedIterable(iterator: Iterator): IndexedIterable; - export function IndexedIterable(iterable: /*Iterable*/Object): IndexedIterable; - - export interface IndexedIterable extends Iterable { - - // Reading values - - /** - * Returns the value associated with the provided index, or notSetValue if - * the index is beyond the bounds of the Iterable. - * - * `index` may be a negative number, which indexes back from the end of the - * Iterable. `s.get(-1)` gets the last item in the Iterable. - */ - get(index: number, notSetValue?: T): T; - - - // Conversion to Seq - - /** - * Returns IndexedSeq. - * @override - */ - toSeq(): IndexedSeq; - - /** - * If this is an iterable of [key, value] entry tuples, it will return a - * KeyedSeq of those entries. - */ - fromEntrySeq(): KeyedSeq; - - - // Combination - - /** - * Returns an Iterable of the same type with `separator` between each item - * in this Iterable. - */ - interpose(separator: T): /*this*/IndexedIterable; - - /** - * Returns an Iterable of the same type with the provided `iterables` - * interleaved into this iterable. - * - * The resulting Iterable includes the first item from each, then the - * second from each, etc. - * - * I.Seq.of(1,2,3).interleave(I.Seq.of('A','B','C')) - * // Seq [ 1, 'A', 2, 'B', 3, 'C' ] - * - * The shortest Iterable stops interleave. - * - * I.Seq.of(1,2,3).interleave( - * I.Seq.of('A','B'), - * I.Seq.of('X','Y','Z') - * ) - * // Seq [ 1, 'A', 'X', 2, 'B', 'Y' ] - */ - interleave(...iterables: Array>): /*this*/IndexedIterable; - - /** - * Splice returns a new indexed Iterable by replacing a region of this - * Iterable with new values. If values are not provided, it only skips the - * region to be removed. - * - * `index` may be a negative number, which indexes back from the end of the - * Iterable. `s.splice(-2)` splices after the second to last item. - * - * Seq(['a','b','c','d']).splice(1, 2, 'q', 'r', 's') - * // Seq ['a', 'q', 'r', 's', 'd'] - * - */ - splice( - index: number, - removeNum: number, - ...values: /*Array | T>*/any[] - ): /*this*/IndexedIterable; - - /** - * Returns an Iterable of the same type "zipped" with the provided - * iterables. - * - * Like `zipWith`, but using the default `zipper`: creating an `Array`. - * - * var a = Seq.of(1, 2, 3); - * var b = Seq.of(4, 5, 6); - * var c = a.zip(b); // Seq [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] - * - */ - zip(...iterables: Array>): /*this*/IndexedIterable; - - /** - * Returns an Iterable of the same type "zipped" with the provided - * iterables by using a custom `zipper` function. - * - * var a = Seq.of(1, 2, 3); - * var b = Seq.of(4, 5, 6); - * var c = a.zip(b); // Seq [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] - * - */ - zipWith( - zipper: (value: T, otherValue: U) => Z, - otherIterable: Iterable - ): IndexedIterable; - zipWith( - zipper: (value: T, otherValue: U, thirdValue: V) => Z, - otherIterable: Iterable, - thirdIterable: Iterable - ): IndexedIterable; - zipWith( - zipper: (...any: Array) => Z, - ...iterables: Array> - ): IndexedIterable; - - - // Search for value - - /** - * Returns the first index at which a given value can be found in the - * Iterable, or -1 if it is not present. - */ - indexOf(searchValue: T): number; - - /** - * Returns the last index at which a given value can be found in the - * Iterable, or -1 if it is not present. - */ - lastIndexOf(searchValue: T): number; - - /** - * Returns the first index in the Iterable where a value satisfies the - * provided predicate function. Otherwise -1 is returned. - */ - findIndex( - predicate: (value?: T, index?: number, iter?: /*this*/IndexedIterable) => boolean, - context?: any - ): number; - - /** - * Returns the last index in the Iterable where a value satisfies the - * provided predicate function. Otherwise -1 is returned. - */ - findLastIndex( - predicate: (value?: T, index?: number, iter?: /*this*/IndexedIterable) => boolean, - context?: any - ): number; - } - - - /** - * Set Iterables only represent values. They have no associated keys or - * indices. Duplicate values are possible in SetSeqs, however the - * concrete `Set` does not allow duplicate values. - * - * Iterable methods on SetIterable such as `map` and `forEach` will provide - * the value as both the first and second arguments to the provided function. - * - * var seq = SetSeq.of('A', 'B', 'C'); - * assert.equal(seq.every((v, k) => v === k), true); - * - */ - export module SetIterable {} - - /** - * Similar to `Iterable()`, but always returns a SetIterable. - */ - export function SetIterable(iter: SetIterable): SetIterable; - export function SetIterable(iter: IndexedIterable): SetIterable; - export function SetIterable(iter: KeyedIterable): SetIterable; - export function SetIterable(array: Array): SetIterable; - export function SetIterable(iterator: Iterator): SetIterable; - export function SetIterable(iterable: /*Iterable*/Object): SetIterable; - - export interface SetIterable extends Iterable { - - /** - * Returns SetSeq. - * @override - */ - toSeq(): SetSeq; - } - - - /** - * Collection is the abstract base class for concrete data structures. It - * cannot be constructed directly. - * - * Implementations should extend one of the subclasses, `KeyedCollection`, - * `IndexedCollection`, or `SetCollection`. - */ - export module Collection {} - - export interface Collection extends Iterable { - - /** - * All collections maintain their current `size` as an integer. - */ - size: number; - } - - - /** - * `Collection` which represents key-value pairs. - */ - export module KeyedCollection {} - - export interface KeyedCollection extends Collection, KeyedIterable { - - /** - * Returns KeyedSeq. - * @override - */ - toSeq(): KeyedSeq; - } - - - /** - * `Collection` which represents ordered indexed values. - */ - export module IndexedCollection {} - - export interface IndexedCollection extends Collection, IndexedIterable { - - /** - * Returns IndexedSeq. - * @override - */ - toSeq(): IndexedSeq; - } - - - /** - * `Collection` which represents values, unassociated with keys or indices. - * - * `SetCollection` implementations should guarantee value uniqueness. - */ - export module SetCollection {} - - export interface SetCollection extends Collection, SetIterable { - - /** - * Returns SetSeq. - * @override - */ - toSeq(): SetSeq; - } - - - /** - * ES6 Iterator. - * - * This is not part of the Immutable library, but a common interface used by - * many types in ES6 JavaScript. - * - * @ignore - */ - export interface Iterator { - next(): { value: T; done: boolean; } - } - -} diff --git a/dist/immutable.js b/dist/immutable.js deleted file mode 100644 index 87537c4c6d..0000000000 --- a/dist/immutable.js +++ /dev/null @@ -1,4926 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - global.Immutable = factory() -}(this, function () { 'use strict';var SLICE$0 = Array.prototype.slice; - - function createClass(ctor, superClass) { - if (superClass) { - ctor.prototype = Object.create(superClass.prototype); - } - ctor.prototype.constructor = ctor; - } - - // Used for setting prototype methods that IE8 chokes on. - var DELETE = 'delete'; - - // Constants describing the size of trie nodes. - var SHIFT = 5; // Resulted in best performance after ______? - var SIZE = 1 << SHIFT; - var MASK = SIZE - 1; - - // A consistent shared value representing "not set" which equals nothing other - // than itself, and nothing that could be provided externally. - var NOT_SET = {}; - - // Boolean references, Rough equivalent of `bool &`. - var CHANGE_LENGTH = { value: false }; - var DID_ALTER = { value: false }; - - function MakeRef(ref) { - ref.value = false; - return ref; - } - - function SetRef(ref) { - ref && (ref.value = true); - } - - // A function which returns a value representing an "owner" for transient writes - // to tries. The return value will only ever equal itself, and will not equal - // the return of any subsequent call of this function. - function OwnerID() {} - - // http://jsperf.com/copy-array-inline - function arrCopy(arr, offset) { - offset = offset || 0; - var len = Math.max(0, arr.length - offset); - var newArr = new Array(len); - for (var ii = 0; ii < len; ii++) { - newArr[ii] = arr[ii + offset]; - } - return newArr; - } - - function ensureSize(iter) { - if (iter.size === undefined) { - iter.size = iter.__iterate(returnTrue); - } - return iter.size; - } - - function wrapIndex(iter, index) { - return index >= 0 ? (+index) : ensureSize(iter) + (+index); - } - - function returnTrue() { - return true; - } - - function wholeSlice(begin, end, size) { - return (begin === 0 || (size !== undefined && begin <= -size)) && - (end === undefined || (size !== undefined && end >= size)); - } - - function resolveBegin(begin, size) { - return resolveIndex(begin, size, 0); - } - - function resolveEnd(end, size) { - return resolveIndex(end, size, size); - } - - function resolveIndex(index, size, defaultIndex) { - return index === undefined ? - defaultIndex : - index < 0 ? - Math.max(0, size + index) : - size === undefined ? - index : - Math.min(size, index); - } - - function Iterable(value) { - return isIterable(value) ? value : Seq(value); - } - - - createClass(KeyedIterable, Iterable); - function KeyedIterable(value) { - return isKeyed(value) ? value : KeyedSeq(value); - } - - - createClass(IndexedIterable, Iterable); - function IndexedIterable(value) { - return isIndexed(value) ? value : IndexedSeq(value); - } - - - createClass(SetIterable, Iterable); - function SetIterable(value) { - return isIterable(value) && !isAssociative(value) ? value : SetSeq(value); - } - - - - function isIterable(maybeIterable) { - return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]); - } - - function isKeyed(maybeKeyed) { - return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]); - } - - function isIndexed(maybeIndexed) { - return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]); - } - - function isAssociative(maybeAssociative) { - return isKeyed(maybeAssociative) || isIndexed(maybeAssociative); - } - - function isOrdered(maybeOrdered) { - return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]); - } - - Iterable.isIterable = isIterable; - Iterable.isKeyed = isKeyed; - Iterable.isIndexed = isIndexed; - Iterable.isAssociative = isAssociative; - Iterable.isOrdered = isOrdered; - - Iterable.Keyed = KeyedIterable; - Iterable.Indexed = IndexedIterable; - Iterable.Set = SetIterable; - - - var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; - var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@'; - var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@'; - var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; - - /* global Symbol */ - - var ITERATE_KEYS = 0; - var ITERATE_VALUES = 1; - var ITERATE_ENTRIES = 2; - - var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; - var FAUX_ITERATOR_SYMBOL = '@@iterator'; - - var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL; - - - function src_Iterator__Iterator(next) { - this.next = next; - } - - src_Iterator__Iterator.prototype.toString = function() { - return '[Iterator]'; - }; - - - src_Iterator__Iterator.KEYS = ITERATE_KEYS; - src_Iterator__Iterator.VALUES = ITERATE_VALUES; - src_Iterator__Iterator.ENTRIES = ITERATE_ENTRIES; - - src_Iterator__Iterator.prototype.inspect = - src_Iterator__Iterator.prototype.toSource = function () { return this.toString(); } - src_Iterator__Iterator.prototype[ITERATOR_SYMBOL] = function () { - return this; - }; - - - function iteratorValue(type, k, v, iteratorResult) { - var value = type === 0 ? k : type === 1 ? v : [k, v]; - iteratorResult ? (iteratorResult.value = value) : (iteratorResult = { - value: value, done: false - }); - return iteratorResult; - } - - function iteratorDone() { - return { value: undefined, done: true }; - } - - function hasIterator(maybeIterable) { - return !!getIteratorFn(maybeIterable); - } - - function isIterator(maybeIterator) { - return maybeIterator && typeof maybeIterator.next === 'function'; - } - - function getIterator(iterable) { - var iteratorFn = getIteratorFn(iterable); - return iteratorFn && iteratorFn.call(iterable); - } - - function getIteratorFn(iterable) { - var iteratorFn = iterable && ( - (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) || - iterable[FAUX_ITERATOR_SYMBOL] - ); - if (typeof iteratorFn === 'function') { - return iteratorFn; - } - } - - function isArrayLike(value) { - return value && typeof value.length === 'number'; - } - - createClass(Seq, Iterable); - function Seq(value) { - return value === null || value === undefined ? emptySequence() : - isIterable(value) ? value.toSeq() : seqFromValue(value); - } - - Seq.of = function(/*...values*/) { - return Seq(arguments); - }; - - Seq.prototype.toSeq = function() { - return this; - }; - - Seq.prototype.toString = function() { - return this.__toString('Seq {', '}'); - }; - - Seq.prototype.cacheResult = function() { - if (!this._cache && this.__iterateUncached) { - this._cache = this.entrySeq().toArray(); - this.size = this._cache.length; - } - return this; - }; - - // abstract __iterateUncached(fn, reverse) - - Seq.prototype.__iterate = function(fn, reverse) { - return seqIterate(this, fn, reverse, true); - }; - - // abstract __iteratorUncached(type, reverse) - - Seq.prototype.__iterator = function(type, reverse) { - return seqIterator(this, type, reverse, true); - }; - - - - createClass(KeyedSeq, Seq); - function KeyedSeq(value) { - return value === null || value === undefined ? - emptySequence().toKeyedSeq() : - isIterable(value) ? - (isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) : - keyedSeqFromValue(value); - } - - KeyedSeq.prototype.toKeyedSeq = function() { - return this; - }; - - - - createClass(IndexedSeq, Seq); - function IndexedSeq(value) { - return value === null || value === undefined ? emptySequence() : - !isIterable(value) ? indexedSeqFromValue(value) : - isKeyed(value) ? value.entrySeq() : value.toIndexedSeq(); - } - - IndexedSeq.of = function(/*...values*/) { - return IndexedSeq(arguments); - }; - - IndexedSeq.prototype.toIndexedSeq = function() { - return this; - }; - - IndexedSeq.prototype.toString = function() { - return this.__toString('Seq [', ']'); - }; - - IndexedSeq.prototype.__iterate = function(fn, reverse) { - return seqIterate(this, fn, reverse, false); - }; - - IndexedSeq.prototype.__iterator = function(type, reverse) { - return seqIterator(this, type, reverse, false); - }; - - - - createClass(SetSeq, Seq); - function SetSeq(value) { - return ( - value === null || value === undefined ? emptySequence() : - !isIterable(value) ? indexedSeqFromValue(value) : - isKeyed(value) ? value.entrySeq() : value - ).toSetSeq(); - } - - SetSeq.of = function(/*...values*/) { - return SetSeq(arguments); - }; - - SetSeq.prototype.toSetSeq = function() { - return this; - }; - - - - Seq.isSeq = isSeq; - Seq.Keyed = KeyedSeq; - Seq.Set = SetSeq; - Seq.Indexed = IndexedSeq; - - var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@'; - - Seq.prototype[IS_SEQ_SENTINEL] = true; - - - - // #pragma Root Sequences - - createClass(ArraySeq, IndexedSeq); - function ArraySeq(array) { - this._array = array; - this.size = array.length; - } - - ArraySeq.prototype.get = function(index, notSetValue) { - return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue; - }; - - ArraySeq.prototype.__iterate = function(fn, reverse) { - var array = this._array; - var maxIndex = array.length - 1; - for (var ii = 0; ii <= maxIndex; ii++) { - if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) { - return ii + 1; - } - } - return ii; - }; - - ArraySeq.prototype.__iterator = function(type, reverse) { - var array = this._array; - var maxIndex = array.length - 1; - var ii = 0; - return new src_Iterator__Iterator(function() - {return ii > maxIndex ? - iteratorDone() : - iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++])} - ); - }; - - - - createClass(ObjectSeq, KeyedSeq); - function ObjectSeq(object) { - var keys = Object.keys(object); - this._object = object; - this._keys = keys; - this.size = keys.length; - } - - ObjectSeq.prototype.get = function(key, notSetValue) { - if (notSetValue !== undefined && !this.has(key)) { - return notSetValue; - } - return this._object[key]; - }; - - ObjectSeq.prototype.has = function(key) { - return this._object.hasOwnProperty(key); - }; - - ObjectSeq.prototype.__iterate = function(fn, reverse) { - var object = this._object; - var keys = this._keys; - var maxIndex = keys.length - 1; - for (var ii = 0; ii <= maxIndex; ii++) { - var key = keys[reverse ? maxIndex - ii : ii]; - if (fn(object[key], key, this) === false) { - return ii + 1; - } - } - return ii; - }; - - ObjectSeq.prototype.__iterator = function(type, reverse) { - var object = this._object; - var keys = this._keys; - var maxIndex = keys.length - 1; - var ii = 0; - return new src_Iterator__Iterator(function() { - var key = keys[reverse ? maxIndex - ii : ii]; - return ii++ > maxIndex ? - iteratorDone() : - iteratorValue(type, key, object[key]); - }); - }; - - ObjectSeq.prototype[IS_ORDERED_SENTINEL] = true; - - - createClass(IterableSeq, IndexedSeq); - function IterableSeq(iterable) { - this._iterable = iterable; - this.size = iterable.length || iterable.size; - } - - IterableSeq.prototype.__iterateUncached = function(fn, reverse) { - if (reverse) { - return this.cacheResult().__iterate(fn, reverse); - } - var iterable = this._iterable; - var iterator = getIterator(iterable); - var iterations = 0; - if (isIterator(iterator)) { - var step; - while (!(step = iterator.next()).done) { - if (fn(step.value, iterations++, this) === false) { - break; - } - } - } - return iterations; - }; - - IterableSeq.prototype.__iteratorUncached = function(type, reverse) { - if (reverse) { - return this.cacheResult().__iterator(type, reverse); - } - var iterable = this._iterable; - var iterator = getIterator(iterable); - if (!isIterator(iterator)) { - return new src_Iterator__Iterator(iteratorDone); - } - var iterations = 0; - return new src_Iterator__Iterator(function() { - var step = iterator.next(); - return step.done ? step : iteratorValue(type, iterations++, step.value); - }); - }; - - - - createClass(IteratorSeq, IndexedSeq); - function IteratorSeq(iterator) { - this._iterator = iterator; - this._iteratorCache = []; - } - - IteratorSeq.prototype.__iterateUncached = function(fn, reverse) { - if (reverse) { - return this.cacheResult().__iterate(fn, reverse); - } - var iterator = this._iterator; - var cache = this._iteratorCache; - var iterations = 0; - while (iterations < cache.length) { - if (fn(cache[iterations], iterations++, this) === false) { - return iterations; - } - } - var step; - while (!(step = iterator.next()).done) { - var val = step.value; - cache[iterations] = val; - if (fn(val, iterations++, this) === false) { - break; - } - } - return iterations; - }; - - IteratorSeq.prototype.__iteratorUncached = function(type, reverse) { - if (reverse) { - return this.cacheResult().__iterator(type, reverse); - } - var iterator = this._iterator; - var cache = this._iteratorCache; - var iterations = 0; - return new src_Iterator__Iterator(function() { - if (iterations >= cache.length) { - var step = iterator.next(); - if (step.done) { - return step; - } - cache[iterations] = step.value; - } - return iteratorValue(type, iterations, cache[iterations++]); - }); - }; - - - - - // # pragma Helper functions - - function isSeq(maybeSeq) { - return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]); - } - - var EMPTY_SEQ; - - function emptySequence() { - return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([])); - } - - function keyedSeqFromValue(value) { - var seq = - Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() : - isIterator(value) ? new IteratorSeq(value).fromEntrySeq() : - hasIterator(value) ? new IterableSeq(value).fromEntrySeq() : - typeof value === 'object' ? new ObjectSeq(value) : - undefined; - if (!seq) { - throw new TypeError( - 'Expected Array or iterable object of [k, v] entries, '+ - 'or keyed object: ' + value - ); - } - return seq; - } - - function indexedSeqFromValue(value) { - var seq = maybeIndexedSeqFromValue(value); - if (!seq) { - throw new TypeError( - 'Expected Array or iterable object of values: ' + value - ); - } - return seq; - } - - function seqFromValue(value) { - var seq = maybeIndexedSeqFromValue(value) || - (typeof value === 'object' && new ObjectSeq(value)); - if (!seq) { - throw new TypeError( - 'Expected Array or iterable object of values, or keyed object: ' + value - ); - } - return seq; - } - - function maybeIndexedSeqFromValue(value) { - return ( - isArrayLike(value) ? new ArraySeq(value) : - isIterator(value) ? new IteratorSeq(value) : - hasIterator(value) ? new IterableSeq(value) : - undefined - ); - } - - function seqIterate(seq, fn, reverse, useKeys) { - var cache = seq._cache; - if (cache) { - var maxIndex = cache.length - 1; - for (var ii = 0; ii <= maxIndex; ii++) { - var entry = cache[reverse ? maxIndex - ii : ii]; - if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) { - return ii + 1; - } - } - return ii; - } - return seq.__iterateUncached(fn, reverse); - } - - function seqIterator(seq, type, reverse, useKeys) { - var cache = seq._cache; - if (cache) { - var maxIndex = cache.length - 1; - var ii = 0; - return new src_Iterator__Iterator(function() { - var entry = cache[reverse ? maxIndex - ii : ii]; - return ii++ > maxIndex ? - iteratorDone() : - iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]); - }); - } - return seq.__iteratorUncached(type, reverse); - } - - createClass(Collection, Iterable); - function Collection() { - throw TypeError('Abstract'); - } - - - createClass(KeyedCollection, Collection);function KeyedCollection() {} - - createClass(IndexedCollection, Collection);function IndexedCollection() {} - - createClass(SetCollection, Collection);function SetCollection() {} - - - Collection.Keyed = KeyedCollection; - Collection.Indexed = IndexedCollection; - Collection.Set = SetCollection; - - /** - * An extension of the "same-value" algorithm as [described for use by ES6 Map - * and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality) - * - * NaN is considered the same as NaN, however -0 and 0 are considered the same - * value, which is different from the algorithm described by - * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is). - * - * This is extended further to allow Objects to describe the values they - * represent, by way of `valueOf` or `equals` (and `hashCode`). - * - * Note: because of this extension, the key equality of Immutable.Map and the - * value equality of Immutable.Set will differ from ES6 Map and Set. - * - * ### Defining custom values - * - * The easiest way to describe the value an object represents is by implementing - * `valueOf`. For example, `Date` represents a value by returning a unix - * timestamp for `valueOf`: - * - * var date1 = new Date(1234567890000); // Fri Feb 13 2009 ... - * var date2 = new Date(1234567890000); - * date1.valueOf(); // 1234567890000 - * assert( date1 !== date2 ); - * assert( Immutable.is( date1, date2 ) ); - * - * Note: overriding `valueOf` may have other implications if you use this object - * where JavaScript expects a primitive, such as implicit string coercion. - * - * For more complex types, especially collections, implementing `valueOf` may - * not be performant. An alternative is to implement `equals` and `hashCode`. - * - * `equals` takes another object, presumably of similar type, and returns true - * if the it is equal. Equality is symmetrical, so the same result should be - * returned if this and the argument are flipped. - * - * assert( a.equals(b) === b.equals(a) ); - * - * `hashCode` returns a 32bit integer number representing the object which will - * be used to determine how to store the value object in a Map or Set. You must - * provide both or neither methods, one must not exist without the other. - * - * Also, an important relationship between these methods must be upheld: if two - * values are equal, they *must* return the same hashCode. If the values are not - * equal, they might have the same hashCode; this is called a hash collision, - * and while undesirable for performance reasons, it is acceptable. - * - * if (a.equals(b)) { - * assert( a.hashCode() === b.hashCode() ); - * } - * - * All Immutable collections implement `equals` and `hashCode`. - * - */ - function is(valueA, valueB) { - if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { - return true; - } - if (!valueA || !valueB) { - return false; - } - if (typeof valueA.valueOf === 'function' && - typeof valueB.valueOf === 'function') { - valueA = valueA.valueOf(); - valueB = valueB.valueOf(); - if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { - return true; - } - if (!valueA || !valueB) { - return false; - } - } - if (typeof valueA.equals === 'function' && - typeof valueB.equals === 'function' && - valueA.equals(valueB)) { - return true; - } - return false; - } - - function fromJS(json, converter) { - return converter ? - fromJSWith(converter, json, '', {'': json}) : - fromJSDefault(json); - } - - function fromJSWith(converter, json, key, parentJSON) { - if (Array.isArray(json)) { - return converter.call(parentJSON, key, IndexedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)})); - } - if (isPlainObj(json)) { - return converter.call(parentJSON, key, KeyedSeq(json).map(function(v, k) {return fromJSWith(converter, v, k, json)})); - } - return json; - } - - function fromJSDefault(json) { - if (Array.isArray(json)) { - return IndexedSeq(json).map(fromJSDefault).toList(); - } - if (isPlainObj(json)) { - return KeyedSeq(json).map(fromJSDefault).toMap(); - } - return json; - } - - function isPlainObj(value) { - return value && (value.constructor === Object || value.constructor === undefined); - } - - var src_Math__imul = - typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ? - Math.imul : - function imul(a, b) { - a = a | 0; // int - b = b | 0; // int - var c = a & 0xffff; - var d = b & 0xffff; - // Shift by 0 fixes the sign on the high part. - return (c * d) + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0) | 0; // int - }; - - // v8 has an optimization for storing 31-bit signed numbers. - // Values which have either 00 or 11 as the high order bits qualify. - // This function drops the highest order bit in a signed number, maintaining - // the sign bit. - function smi(i32) { - return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF); - } - - function hash(o) { - if (o === false || o === null || o === undefined) { - return 0; - } - if (typeof o.valueOf === 'function') { - o = o.valueOf(); - if (o === false || o === null || o === undefined) { - return 0; - } - } - if (o === true) { - return 1; - } - var type = typeof o; - if (type === 'number') { - var h = o | 0; - if (h !== o) { - h ^= o * 0xFFFFFFFF; - } - while (o > 0xFFFFFFFF) { - o /= 0xFFFFFFFF; - h ^= o; - } - return smi(h); - } - if (type === 'string') { - return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o); - } - if (typeof o.hashCode === 'function') { - return o.hashCode(); - } - return hashJSObj(o); - } - - function cachedHashString(string) { - var hash = stringHashCache[string]; - if (hash === undefined) { - hash = hashString(string); - if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) { - STRING_HASH_CACHE_SIZE = 0; - stringHashCache = {}; - } - STRING_HASH_CACHE_SIZE++; - stringHashCache[string] = hash; - } - return hash; - } - - // http://jsperf.com/hashing-strings - function hashString(string) { - // This is the hash from JVM - // The hash code for a string is computed as - // s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1], - // where s[i] is the ith character of the string and n is the length of - // the string. We "mod" the result to make it between 0 (inclusive) and 2^31 - // (exclusive) by dropping high bits. - var hash = 0; - for (var ii = 0; ii < string.length; ii++) { - hash = 31 * hash + string.charCodeAt(ii) | 0; - } - return smi(hash); - } - - function hashJSObj(obj) { - var hash; - if (usingWeakMap) { - hash = weakMap.get(obj); - if (hash !== undefined) { - return hash; - } - } - - hash = obj[UID_HASH_KEY]; - if (hash !== undefined) { - return hash; - } - - if (!canDefineProperty) { - hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY]; - if (hash !== undefined) { - return hash; - } - - hash = getIENodeHash(obj); - if (hash !== undefined) { - return hash; - } - } - - hash = ++objHashUID; - if (objHashUID & 0x40000000) { - objHashUID = 0; - } - - if (usingWeakMap) { - weakMap.set(obj, hash); - } else if (isExtensible !== undefined && isExtensible(obj) === false) { - throw new Error('Non-extensible objects are not allowed as keys.'); - } else if (canDefineProperty) { - Object.defineProperty(obj, UID_HASH_KEY, { - 'enumerable': false, - 'configurable': false, - 'writable': false, - 'value': hash - }); - } else if (obj.propertyIsEnumerable !== undefined && - obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) { - // Since we can't define a non-enumerable property on the object - // we'll hijack one of the less-used non-enumerable properties to - // save our hash on it. Since this is a function it will not show up in - // `JSON.stringify` which is what we want. - obj.propertyIsEnumerable = function() { - return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments); - }; - obj.propertyIsEnumerable[UID_HASH_KEY] = hash; - } else if (obj.nodeType !== undefined) { - // At this point we couldn't get the IE `uniqueID` to use as a hash - // and we couldn't use a non-enumerable property to exploit the - // dontEnum bug so we simply add the `UID_HASH_KEY` on the node - // itself. - obj[UID_HASH_KEY] = hash; - } else { - throw new Error('Unable to set a non-enumerable property on object.'); - } - - return hash; - } - - // Get references to ES5 object methods. - var isExtensible = Object.isExtensible; - - // True if Object.defineProperty works as expected. IE8 fails this test. - var canDefineProperty = (function() { - try { - Object.defineProperty({}, '@', {}); - return true; - } catch (e) { - return false; - } - }()); - - // IE has a `uniqueID` property on DOM nodes. We can construct the hash from it - // and avoid memory leaks from the IE cloneNode bug. - function getIENodeHash(node) { - if (node && node.nodeType > 0) { - switch (node.nodeType) { - case 1: // Element - return node.uniqueID; - case 9: // Document - return node.documentElement && node.documentElement.uniqueID; - } - } - } - - // If possible, use a WeakMap. - var usingWeakMap = typeof WeakMap === 'function'; - var weakMap; - if (usingWeakMap) { - weakMap = new WeakMap(); - } - - var objHashUID = 0; - - var UID_HASH_KEY = '__immutablehash__'; - if (typeof Symbol === 'function') { - UID_HASH_KEY = Symbol(UID_HASH_KEY); - } - - var STRING_HASH_CACHE_MIN_STRLEN = 16; - var STRING_HASH_CACHE_MAX_SIZE = 255; - var STRING_HASH_CACHE_SIZE = 0; - var stringHashCache = {}; - - function invariant(condition, error) { - if (!condition) throw new Error(error); - } - - function assertNotInfinite(size) { - invariant( - size !== Infinity, - 'Cannot perform this action with an infinite size.' - ); - } - - createClass(ToKeyedSequence, KeyedSeq); - function ToKeyedSequence(indexed, useKeys) { - this._iter = indexed; - this._useKeys = useKeys; - this.size = indexed.size; - } - - ToKeyedSequence.prototype.get = function(key, notSetValue) { - return this._iter.get(key, notSetValue); - }; - - ToKeyedSequence.prototype.has = function(key) { - return this._iter.has(key); - }; - - ToKeyedSequence.prototype.valueSeq = function() { - return this._iter.valueSeq(); - }; - - ToKeyedSequence.prototype.reverse = function() {var this$0 = this; - var reversedSequence = reverseFactory(this, true); - if (!this._useKeys) { - reversedSequence.valueSeq = function() {return this$0._iter.toSeq().reverse()}; - } - return reversedSequence; - }; - - ToKeyedSequence.prototype.map = function(mapper, context) {var this$0 = this; - var mappedSequence = mapFactory(this, mapper, context); - if (!this._useKeys) { - mappedSequence.valueSeq = function() {return this$0._iter.toSeq().map(mapper, context)}; - } - return mappedSequence; - }; - - ToKeyedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; - var ii; - return this._iter.__iterate( - this._useKeys ? - function(v, k) {return fn(v, k, this$0)} : - ((ii = reverse ? resolveSize(this) : 0), - function(v ) {return fn(v, reverse ? --ii : ii++, this$0)}), - reverse - ); - }; - - ToKeyedSequence.prototype.__iterator = function(type, reverse) { - if (this._useKeys) { - return this._iter.__iterator(type, reverse); - } - var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); - var ii = reverse ? resolveSize(this) : 0; - return new src_Iterator__Iterator(function() { - var step = iterator.next(); - return step.done ? step : - iteratorValue(type, reverse ? --ii : ii++, step.value, step); - }); - }; - - ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true; - - - createClass(ToIndexedSequence, IndexedSeq); - function ToIndexedSequence(iter) { - this._iter = iter; - this.size = iter.size; - } - - ToIndexedSequence.prototype.includes = function(value) { - return this._iter.includes(value); - }; - - ToIndexedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; - var iterations = 0; - return this._iter.__iterate(function(v ) {return fn(v, iterations++, this$0)}, reverse); - }; - - ToIndexedSequence.prototype.__iterator = function(type, reverse) { - var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); - var iterations = 0; - return new src_Iterator__Iterator(function() { - var step = iterator.next(); - return step.done ? step : - iteratorValue(type, iterations++, step.value, step) - }); - }; - - - - createClass(ToSetSequence, SetSeq); - function ToSetSequence(iter) { - this._iter = iter; - this.size = iter.size; - } - - ToSetSequence.prototype.has = function(key) { - return this._iter.includes(key); - }; - - ToSetSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; - return this._iter.__iterate(function(v ) {return fn(v, v, this$0)}, reverse); - }; - - ToSetSequence.prototype.__iterator = function(type, reverse) { - var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); - return new src_Iterator__Iterator(function() { - var step = iterator.next(); - return step.done ? step : - iteratorValue(type, step.value, step.value, step); - }); - }; - - - - createClass(FromEntriesSequence, KeyedSeq); - function FromEntriesSequence(entries) { - this._iter = entries; - this.size = entries.size; - } - - FromEntriesSequence.prototype.entrySeq = function() { - return this._iter.toSeq(); - }; - - FromEntriesSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this; - return this._iter.__iterate(function(entry ) { - // Check if entry exists first so array access doesn't throw for holes - // in the parent iteration. - if (entry) { - validateEntry(entry); - var indexedIterable = isIterable(entry); - return fn( - indexedIterable ? entry.get(1) : entry[1], - indexedIterable ? entry.get(0) : entry[0], - this$0 - ); - } - }, reverse); - }; - - FromEntriesSequence.prototype.__iterator = function(type, reverse) { - var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); - return new src_Iterator__Iterator(function() { - while (true) { - var step = iterator.next(); - if (step.done) { - return step; - } - var entry = step.value; - // Check if entry exists first so array access doesn't throw for holes - // in the parent iteration. - if (entry) { - validateEntry(entry); - var indexedIterable = isIterable(entry); - return iteratorValue( - type, - indexedIterable ? entry.get(0) : entry[0], - indexedIterable ? entry.get(1) : entry[1], - step - ); - } - } - }); - }; - - - ToIndexedSequence.prototype.cacheResult = - ToKeyedSequence.prototype.cacheResult = - ToSetSequence.prototype.cacheResult = - FromEntriesSequence.prototype.cacheResult = - cacheResultThrough; - - - function flipFactory(iterable) { - var flipSequence = makeSequence(iterable); - flipSequence._iter = iterable; - flipSequence.size = iterable.size; - flipSequence.flip = function() {return iterable}; - flipSequence.reverse = function () { - var reversedSequence = iterable.reverse.apply(this); // super.reverse() - reversedSequence.flip = function() {return iterable.reverse()}; - return reversedSequence; - }; - flipSequence.has = function(key ) {return iterable.includes(key)}; - flipSequence.includes = function(key ) {return iterable.has(key)}; - flipSequence.cacheResult = cacheResultThrough; - flipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; - return iterable.__iterate(function(v, k) {return fn(k, v, this$0) !== false}, reverse); - } - flipSequence.__iteratorUncached = function(type, reverse) { - if (type === ITERATE_ENTRIES) { - var iterator = iterable.__iterator(type, reverse); - return new src_Iterator__Iterator(function() { - var step = iterator.next(); - if (!step.done) { - var k = step.value[0]; - step.value[0] = step.value[1]; - step.value[1] = k; - } - return step; - }); - } - return iterable.__iterator( - type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, - reverse - ); - } - return flipSequence; - } - - - function mapFactory(iterable, mapper, context) { - var mappedSequence = makeSequence(iterable); - mappedSequence.size = iterable.size; - mappedSequence.has = function(key ) {return iterable.has(key)}; - mappedSequence.get = function(key, notSetValue) { - var v = iterable.get(key, NOT_SET); - return v === NOT_SET ? - notSetValue : - mapper.call(context, v, key, iterable); - }; - mappedSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; - return iterable.__iterate( - function(v, k, c) {return fn(mapper.call(context, v, k, c), k, this$0) !== false}, - reverse - ); - } - mappedSequence.__iteratorUncached = function (type, reverse) { - var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); - return new src_Iterator__Iterator(function() { - var step = iterator.next(); - if (step.done) { - return step; - } - var entry = step.value; - var key = entry[0]; - return iteratorValue( - type, - key, - mapper.call(context, entry[1], key, iterable), - step - ); - }); - } - return mappedSequence; - } - - - function reverseFactory(iterable, useKeys) { - var reversedSequence = makeSequence(iterable); - reversedSequence._iter = iterable; - reversedSequence.size = iterable.size; - reversedSequence.reverse = function() {return iterable}; - if (iterable.flip) { - reversedSequence.flip = function () { - var flipSequence = flipFactory(iterable); - flipSequence.reverse = function() {return iterable.flip()}; - return flipSequence; - }; - } - reversedSequence.get = function(key, notSetValue) - {return iterable.get(useKeys ? key : -1 - key, notSetValue)}; - reversedSequence.has = function(key ) - {return iterable.has(useKeys ? key : -1 - key)}; - reversedSequence.includes = function(value ) {return iterable.includes(value)}; - reversedSequence.cacheResult = cacheResultThrough; - reversedSequence.__iterate = function (fn, reverse) {var this$0 = this; - return iterable.__iterate(function(v, k) {return fn(v, k, this$0)}, !reverse); - }; - reversedSequence.__iterator = - function(type, reverse) {return iterable.__iterator(type, !reverse)}; - return reversedSequence; - } - - - function filterFactory(iterable, predicate, context, useKeys) { - var filterSequence = makeSequence(iterable); - if (useKeys) { - filterSequence.has = function(key ) { - var v = iterable.get(key, NOT_SET); - return v !== NOT_SET && !!predicate.call(context, v, key, iterable); - }; - filterSequence.get = function(key, notSetValue) { - var v = iterable.get(key, NOT_SET); - return v !== NOT_SET && predicate.call(context, v, key, iterable) ? - v : notSetValue; - }; - } - filterSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; - var iterations = 0; - iterable.__iterate(function(v, k, c) { - if (predicate.call(context, v, k, c)) { - iterations++; - return fn(v, useKeys ? k : iterations - 1, this$0); - } - }, reverse); - return iterations; - }; - filterSequence.__iteratorUncached = function (type, reverse) { - var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); - var iterations = 0; - return new src_Iterator__Iterator(function() { - while (true) { - var step = iterator.next(); - if (step.done) { - return step; - } - var entry = step.value; - var key = entry[0]; - var value = entry[1]; - if (predicate.call(context, value, key, iterable)) { - return iteratorValue(type, useKeys ? key : iterations++, value, step); - } - } - }); - } - return filterSequence; - } - - - function countByFactory(iterable, grouper, context) { - var groups = src_Map__Map().asMutable(); - iterable.__iterate(function(v, k) { - groups.update( - grouper.call(context, v, k, iterable), - 0, - function(a ) {return a + 1} - ); - }); - return groups.asImmutable(); - } - - - function groupByFactory(iterable, grouper, context) { - var isKeyedIter = isKeyed(iterable); - var groups = (isOrdered(iterable) ? OrderedMap() : src_Map__Map()).asMutable(); - iterable.__iterate(function(v, k) { - groups.update( - grouper.call(context, v, k, iterable), - function(a ) {return (a = a || [], a.push(isKeyedIter ? [k, v] : v), a)} - ); - }); - var coerce = iterableClass(iterable); - return groups.map(function(arr ) {return reify(iterable, coerce(arr))}); - } - - - function sliceFactory(iterable, begin, end, useKeys) { - var originalSize = iterable.size; - - if (wholeSlice(begin, end, originalSize)) { - return iterable; - } - - var resolvedBegin = resolveBegin(begin, originalSize); - var resolvedEnd = resolveEnd(end, originalSize); - - // begin or end will be NaN if they were provided as negative numbers and - // this iterable's size is unknown. In that case, cache first so there is - // a known size and these do not resolve to NaN. - if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) { - return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys); - } - - // Note: resolvedEnd is undefined when the original sequence's length is - // unknown and this slice did not supply an end and should contain all - // elements after resolvedBegin. - // In that case, resolvedSize will be NaN and sliceSize will remain undefined. - var resolvedSize = resolvedEnd - resolvedBegin; - var sliceSize; - if (resolvedSize === resolvedSize) { - sliceSize = resolvedSize < 0 ? 0 : resolvedSize; - } - - var sliceSeq = makeSequence(iterable); - - sliceSeq.size = sliceSize; - - if (!useKeys && isSeq(iterable) && sliceSize >= 0) { - sliceSeq.get = function (index, notSetValue) { - index = wrapIndex(this, index); - return index >= 0 && index < sliceSize ? - iterable.get(index + resolvedBegin, notSetValue) : - notSetValue; - } - } - - sliceSeq.__iterateUncached = function(fn, reverse) {var this$0 = this; - if (sliceSize === 0) { - return 0; - } - if (reverse) { - return this.cacheResult().__iterate(fn, reverse); - } - var skipped = 0; - var isSkipping = true; - var iterations = 0; - iterable.__iterate(function(v, k) { - if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) { - iterations++; - return fn(v, useKeys ? k : iterations - 1, this$0) !== false && - iterations !== sliceSize; - } - }); - return iterations; - }; - - sliceSeq.__iteratorUncached = function(type, reverse) { - if (sliceSize !== 0 && reverse) { - return this.cacheResult().__iterator(type, reverse); - } - // Don't bother instantiating parent iterator if taking 0. - var iterator = sliceSize !== 0 && iterable.__iterator(type, reverse); - var skipped = 0; - var iterations = 0; - return new src_Iterator__Iterator(function() { - while (skipped++ < resolvedBegin) { - iterator.next(); - } - if (++iterations > sliceSize) { - return iteratorDone(); - } - var step = iterator.next(); - if (useKeys || type === ITERATE_VALUES) { - return step; - } else if (type === ITERATE_KEYS) { - return iteratorValue(type, iterations - 1, undefined, step); - } else { - return iteratorValue(type, iterations - 1, step.value[1], step); - } - }); - } - - return sliceSeq; - } - - - function takeWhileFactory(iterable, predicate, context) { - var takeSequence = makeSequence(iterable); - takeSequence.__iterateUncached = function(fn, reverse) {var this$0 = this; - if (reverse) { - return this.cacheResult().__iterate(fn, reverse); - } - var iterations = 0; - iterable.__iterate(function(v, k, c) - {return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0)} - ); - return iterations; - }; - takeSequence.__iteratorUncached = function(type, reverse) {var this$0 = this; - if (reverse) { - return this.cacheResult().__iterator(type, reverse); - } - var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); - var iterating = true; - return new src_Iterator__Iterator(function() { - if (!iterating) { - return iteratorDone(); - } - var step = iterator.next(); - if (step.done) { - return step; - } - var entry = step.value; - var k = entry[0]; - var v = entry[1]; - if (!predicate.call(context, v, k, this$0)) { - iterating = false; - return iteratorDone(); - } - return type === ITERATE_ENTRIES ? step : - iteratorValue(type, k, v, step); - }); - }; - return takeSequence; - } - - - function skipWhileFactory(iterable, predicate, context, useKeys) { - var skipSequence = makeSequence(iterable); - skipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this; - if (reverse) { - return this.cacheResult().__iterate(fn, reverse); - } - var isSkipping = true; - var iterations = 0; - iterable.__iterate(function(v, k, c) { - if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) { - iterations++; - return fn(v, useKeys ? k : iterations - 1, this$0); - } - }); - return iterations; - }; - skipSequence.__iteratorUncached = function(type, reverse) {var this$0 = this; - if (reverse) { - return this.cacheResult().__iterator(type, reverse); - } - var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); - var skipping = true; - var iterations = 0; - return new src_Iterator__Iterator(function() { - var step, k, v; - do { - step = iterator.next(); - if (step.done) { - if (useKeys || type === ITERATE_VALUES) { - return step; - } else if (type === ITERATE_KEYS) { - return iteratorValue(type, iterations++, undefined, step); - } else { - return iteratorValue(type, iterations++, step.value[1], step); - } - } - var entry = step.value; - k = entry[0]; - v = entry[1]; - skipping && (skipping = predicate.call(context, v, k, this$0)); - } while (skipping); - return type === ITERATE_ENTRIES ? step : - iteratorValue(type, k, v, step); - }); - }; - return skipSequence; - } - - - function concatFactory(iterable, values) { - var isKeyedIterable = isKeyed(iterable); - var iters = [iterable].concat(values).map(function(v ) { - if (!isIterable(v)) { - v = isKeyedIterable ? - keyedSeqFromValue(v) : - indexedSeqFromValue(Array.isArray(v) ? v : [v]); - } else if (isKeyedIterable) { - v = KeyedIterable(v); - } - return v; - }).filter(function(v ) {return v.size !== 0}); - - if (iters.length === 0) { - return iterable; - } - - if (iters.length === 1) { - var singleton = iters[0]; - if (singleton === iterable || - isKeyedIterable && isKeyed(singleton) || - isIndexed(iterable) && isIndexed(singleton)) { - return singleton; - } - } - - var concatSeq = new ArraySeq(iters); - if (isKeyedIterable) { - concatSeq = concatSeq.toKeyedSeq(); - } else if (!isIndexed(iterable)) { - concatSeq = concatSeq.toSetSeq(); - } - concatSeq = concatSeq.flatten(true); - concatSeq.size = iters.reduce( - function(sum, seq) { - if (sum !== undefined) { - var size = seq.size; - if (size !== undefined) { - return sum + size; - } - } - }, - 0 - ); - return concatSeq; - } - - - function flattenFactory(iterable, depth, useKeys) { - var flatSequence = makeSequence(iterable); - flatSequence.__iterateUncached = function(fn, reverse) { - var iterations = 0; - var stopped = false; - function flatDeep(iter, currentDepth) {var this$0 = this; - iter.__iterate(function(v, k) { - if ((!depth || currentDepth < depth) && isIterable(v)) { - flatDeep(v, currentDepth + 1); - } else if (fn(v, useKeys ? k : iterations++, this$0) === false) { - stopped = true; - } - return !stopped; - }, reverse); - } - flatDeep(iterable, 0); - return iterations; - } - flatSequence.__iteratorUncached = function(type, reverse) { - var iterator = iterable.__iterator(type, reverse); - var stack = []; - var iterations = 0; - return new src_Iterator__Iterator(function() { - while (iterator) { - var step = iterator.next(); - if (step.done !== false) { - iterator = stack.pop(); - continue; - } - var v = step.value; - if (type === ITERATE_ENTRIES) { - v = v[1]; - } - if ((!depth || stack.length < depth) && isIterable(v)) { - stack.push(iterator); - iterator = v.__iterator(type, reverse); - } else { - return useKeys ? step : iteratorValue(type, iterations++, v, step); - } - } - return iteratorDone(); - }); - } - return flatSequence; - } - - - function flatMapFactory(iterable, mapper, context) { - var coerce = iterableClass(iterable); - return iterable.toSeq().map( - function(v, k) {return coerce(mapper.call(context, v, k, iterable))} - ).flatten(true); - } - - - function interposeFactory(iterable, separator) { - var interposedSequence = makeSequence(iterable); - interposedSequence.size = iterable.size && iterable.size * 2 -1; - interposedSequence.__iterateUncached = function(fn, reverse) {var this$0 = this; - var iterations = 0; - iterable.__iterate(function(v, k) - {return (!iterations || fn(separator, iterations++, this$0) !== false) && - fn(v, iterations++, this$0) !== false}, - reverse - ); - return iterations; - }; - interposedSequence.__iteratorUncached = function(type, reverse) { - var iterator = iterable.__iterator(ITERATE_VALUES, reverse); - var iterations = 0; - var step; - return new src_Iterator__Iterator(function() { - if (!step || iterations % 2) { - step = iterator.next(); - if (step.done) { - return step; - } - } - return iterations % 2 ? - iteratorValue(type, iterations++, separator) : - iteratorValue(type, iterations++, step.value, step); - }); - }; - return interposedSequence; - } - - - function sortFactory(iterable, comparator, mapper) { - if (!comparator) { - comparator = defaultComparator; - } - var isKeyedIterable = isKeyed(iterable); - var index = 0; - var entries = iterable.toSeq().map( - function(v, k) {return [k, v, index++, mapper ? mapper(v, k, iterable) : v]} - ).toArray(); - entries.sort(function(a, b) {return comparator(a[3], b[3]) || a[2] - b[2]}).forEach( - isKeyedIterable ? - function(v, i) { entries[i].length = 2; } : - function(v, i) { entries[i] = v[1]; } - ); - return isKeyedIterable ? KeyedSeq(entries) : - isIndexed(iterable) ? IndexedSeq(entries) : - SetSeq(entries); - } - - - function maxFactory(iterable, comparator, mapper) { - if (!comparator) { - comparator = defaultComparator; - } - if (mapper) { - var entry = iterable.toSeq() - .map(function(v, k) {return [v, mapper(v, k, iterable)]}) - .reduce(function(a, b) {return maxCompare(comparator, a[1], b[1]) ? b : a}); - return entry && entry[0]; - } else { - return iterable.reduce(function(a, b) {return maxCompare(comparator, a, b) ? b : a}); - } - } - - function maxCompare(comparator, a, b) { - var comp = comparator(b, a); - // b is considered the new max if the comparator declares them equal, but - // they are not equal and b is in fact a nullish value. - return (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || comp > 0; - } - - - function zipWithFactory(keyIter, zipper, iters) { - var zipSequence = makeSequence(keyIter); - zipSequence.size = new ArraySeq(iters).map(function(i ) {return i.size}).min(); - // Note: this a generic base implementation of __iterate in terms of - // __iterator which may be more generically useful in the future. - zipSequence.__iterate = function(fn, reverse) { - /* generic: - var iterator = this.__iterator(ITERATE_ENTRIES, reverse); - var step; - var iterations = 0; - while (!(step = iterator.next()).done) { - iterations++; - if (fn(step.value[1], step.value[0], this) === false) { - break; - } - } - return iterations; - */ - // indexed: - var iterator = this.__iterator(ITERATE_VALUES, reverse); - var step; - var iterations = 0; - while (!(step = iterator.next()).done) { - if (fn(step.value, iterations++, this) === false) { - break; - } - } - return iterations; - }; - zipSequence.__iteratorUncached = function(type, reverse) { - var iterators = iters.map(function(i ) - {return (i = Iterable(i), getIterator(reverse ? i.reverse() : i))} - ); - var iterations = 0; - var isDone = false; - return new src_Iterator__Iterator(function() { - var steps; - if (!isDone) { - steps = iterators.map(function(i ) {return i.next()}); - isDone = steps.some(function(s ) {return s.done}); - } - if (isDone) { - return iteratorDone(); - } - return iteratorValue( - type, - iterations++, - zipper.apply(null, steps.map(function(s ) {return s.value})) - ); - }); - }; - return zipSequence - } - - - // #pragma Helper Functions - - function reify(iter, seq) { - return isSeq(iter) ? seq : iter.constructor(seq); - } - - function validateEntry(entry) { - if (entry !== Object(entry)) { - throw new TypeError('Expected [K, V] tuple: ' + entry); - } - } - - function resolveSize(iter) { - assertNotInfinite(iter.size); - return ensureSize(iter); - } - - function iterableClass(iterable) { - return isKeyed(iterable) ? KeyedIterable : - isIndexed(iterable) ? IndexedIterable : - SetIterable; - } - - function makeSequence(iterable) { - return Object.create( - ( - isKeyed(iterable) ? KeyedSeq : - isIndexed(iterable) ? IndexedSeq : - SetSeq - ).prototype - ); - } - - function cacheResultThrough() { - if (this._iter.cacheResult) { - this._iter.cacheResult(); - this.size = this._iter.size; - return this; - } else { - return Seq.prototype.cacheResult.call(this); - } - } - - function defaultComparator(a, b) { - return a > b ? 1 : a < b ? -1 : 0; - } - - function forceIterator(keyPath) { - var iter = getIterator(keyPath); - if (!iter) { - // Array might not be iterable in this environment, so we need a fallback - // to our wrapped type. - if (!isArrayLike(keyPath)) { - throw new TypeError('Expected iterable or array-like: ' + keyPath); - } - iter = getIterator(Iterable(keyPath)); - } - return iter; - } - - createClass(src_Map__Map, KeyedCollection); - - // @pragma Construction - - function src_Map__Map(value) { - return value === null || value === undefined ? emptyMap() : - isMap(value) ? value : - emptyMap().withMutations(function(map ) { - var iter = KeyedIterable(value); - assertNotInfinite(iter.size); - iter.forEach(function(v, k) {return map.set(k, v)}); - }); - } - - src_Map__Map.prototype.toString = function() { - return this.__toString('Map {', '}'); - }; - - // @pragma Access - - src_Map__Map.prototype.get = function(k, notSetValue) { - return this._root ? - this._root.get(0, undefined, k, notSetValue) : - notSetValue; - }; - - // @pragma Modification - - src_Map__Map.prototype.set = function(k, v) { - return updateMap(this, k, v); - }; - - src_Map__Map.prototype.setIn = function(keyPath, v) { - return this.updateIn(keyPath, NOT_SET, function() {return v}); - }; - - src_Map__Map.prototype.remove = function(k) { - return updateMap(this, k, NOT_SET); - }; - - src_Map__Map.prototype.deleteIn = function(keyPath) { - return this.updateIn(keyPath, function() {return NOT_SET}); - }; - - src_Map__Map.prototype.update = function(k, notSetValue, updater) { - return arguments.length === 1 ? - k(this) : - this.updateIn([k], notSetValue, updater); - }; - - src_Map__Map.prototype.updateIn = function(keyPath, notSetValue, updater) { - if (!updater) { - updater = notSetValue; - notSetValue = undefined; - } - var updatedValue = updateInDeepMap( - this, - forceIterator(keyPath), - notSetValue, - updater - ); - return updatedValue === NOT_SET ? undefined : updatedValue; - }; - - src_Map__Map.prototype.clear = function() { - if (this.size === 0) { - return this; - } - if (this.__ownerID) { - this.size = 0; - this._root = null; - this.__hash = undefined; - this.__altered = true; - return this; - } - return emptyMap(); - }; - - // @pragma Composition - - src_Map__Map.prototype.merge = function(/*...iters*/) { - return mergeIntoMapWith(this, undefined, arguments); - }; - - src_Map__Map.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1); - return mergeIntoMapWith(this, merger, iters); - }; - - src_Map__Map.prototype.mergeIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1); - return this.updateIn( - keyPath, - emptyMap(), - function(m ) {return typeof m.merge === 'function' ? - m.merge.apply(m, iters) : - iters[iters.length - 1]} - ); - }; - - src_Map__Map.prototype.mergeDeep = function(/*...iters*/) { - return mergeIntoMapWith(this, deepMerger(undefined), arguments); - }; - - src_Map__Map.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1); - return mergeIntoMapWith(this, deepMerger(merger), iters); - }; - - src_Map__Map.prototype.mergeDeepIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1); - return this.updateIn( - keyPath, - emptyMap(), - function(m ) {return typeof m.mergeDeep === 'function' ? - m.mergeDeep.apply(m, iters) : - iters[iters.length - 1]} - ); - }; - - src_Map__Map.prototype.sort = function(comparator) { - // Late binding - return OrderedMap(sortFactory(this, comparator)); - }; - - src_Map__Map.prototype.sortBy = function(mapper, comparator) { - // Late binding - return OrderedMap(sortFactory(this, comparator, mapper)); - }; - - // @pragma Mutability - - src_Map__Map.prototype.withMutations = function(fn) { - var mutable = this.asMutable(); - fn(mutable); - return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this; - }; - - src_Map__Map.prototype.asMutable = function() { - return this.__ownerID ? this : this.__ensureOwner(new OwnerID()); - }; - - src_Map__Map.prototype.asImmutable = function() { - return this.__ensureOwner(); - }; - - src_Map__Map.prototype.wasAltered = function() { - return this.__altered; - }; - - src_Map__Map.prototype.__iterator = function(type, reverse) { - return new MapIterator(this, type, reverse); - }; - - src_Map__Map.prototype.__iterate = function(fn, reverse) {var this$0 = this; - var iterations = 0; - this._root && this._root.iterate(function(entry ) { - iterations++; - return fn(entry[1], entry[0], this$0); - }, reverse); - return iterations; - }; - - src_Map__Map.prototype.__ensureOwner = function(ownerID) { - if (ownerID === this.__ownerID) { - return this; - } - if (!ownerID) { - this.__ownerID = ownerID; - this.__altered = false; - return this; - } - return makeMap(this.size, this._root, ownerID, this.__hash); - }; - - - function isMap(maybeMap) { - return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]); - } - - src_Map__Map.isMap = isMap; - - var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@'; - - var MapPrototype = src_Map__Map.prototype; - MapPrototype[IS_MAP_SENTINEL] = true; - MapPrototype[DELETE] = MapPrototype.remove; - MapPrototype.removeIn = MapPrototype.deleteIn; - - - // #pragma Trie Nodes - - - - function ArrayMapNode(ownerID, entries) { - this.ownerID = ownerID; - this.entries = entries; - } - - ArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) { - var entries = this.entries; - for (var ii = 0, len = entries.length; ii < len; ii++) { - if (is(key, entries[ii][0])) { - return entries[ii][1]; - } - } - return notSetValue; - }; - - ArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { - var removed = value === NOT_SET; - - var entries = this.entries; - var idx = 0; - for (var len = entries.length; idx < len; idx++) { - if (is(key, entries[idx][0])) { - break; - } - } - var exists = idx < len; - - if (exists ? entries[idx][1] === value : removed) { - return this; - } - - SetRef(didAlter); - (removed || !exists) && SetRef(didChangeSize); - - if (removed && entries.length === 1) { - return; // undefined - } - - if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) { - return createNodes(ownerID, entries, key, value); - } - - var isEditable = ownerID && ownerID === this.ownerID; - var newEntries = isEditable ? entries : arrCopy(entries); - - if (exists) { - if (removed) { - idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop()); - } else { - newEntries[idx] = [key, value]; - } - } else { - newEntries.push([key, value]); - } - - if (isEditable) { - this.entries = newEntries; - return this; - } - - return new ArrayMapNode(ownerID, newEntries); - }; - - - - - function BitmapIndexedNode(ownerID, bitmap, nodes) { - this.ownerID = ownerID; - this.bitmap = bitmap; - this.nodes = nodes; - } - - BitmapIndexedNode.prototype.get = function(shift, keyHash, key, notSetValue) { - if (keyHash === undefined) { - keyHash = hash(key); - } - var bit = (1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK)); - var bitmap = this.bitmap; - return (bitmap & bit) === 0 ? notSetValue : - this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, keyHash, key, notSetValue); - }; - - BitmapIndexedNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { - if (keyHash === undefined) { - keyHash = hash(key); - } - var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; - var bit = 1 << keyHashFrag; - var bitmap = this.bitmap; - var exists = (bitmap & bit) !== 0; - - if (!exists && value === NOT_SET) { - return this; - } - - var idx = popCount(bitmap & (bit - 1)); - var nodes = this.nodes; - var node = exists ? nodes[idx] : undefined; - var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); - - if (newNode === node) { - return this; - } - - if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) { - return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode); - } - - if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) { - return nodes[idx ^ 1]; - } - - if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) { - return newNode; - } - - var isEditable = ownerID && ownerID === this.ownerID; - var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit; - var newNodes = exists ? newNode ? - setIn(nodes, idx, newNode, isEditable) : - spliceOut(nodes, idx, isEditable) : - spliceIn(nodes, idx, newNode, isEditable); - - if (isEditable) { - this.bitmap = newBitmap; - this.nodes = newNodes; - return this; - } - - return new BitmapIndexedNode(ownerID, newBitmap, newNodes); - }; - - - - - function HashArrayMapNode(ownerID, count, nodes) { - this.ownerID = ownerID; - this.count = count; - this.nodes = nodes; - } - - HashArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) { - if (keyHash === undefined) { - keyHash = hash(key); - } - var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; - var node = this.nodes[idx]; - return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue; - }; - - HashArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { - if (keyHash === undefined) { - keyHash = hash(key); - } - var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; - var removed = value === NOT_SET; - var nodes = this.nodes; - var node = nodes[idx]; - - if (removed && !node) { - return this; - } - - var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); - if (newNode === node) { - return this; - } - - var newCount = this.count; - if (!node) { - newCount++; - } else if (!newNode) { - newCount--; - if (newCount < MIN_HASH_ARRAY_MAP_SIZE) { - return packNodes(ownerID, nodes, newCount, idx); - } - } - - var isEditable = ownerID && ownerID === this.ownerID; - var newNodes = setIn(nodes, idx, newNode, isEditable); - - if (isEditable) { - this.count = newCount; - this.nodes = newNodes; - return this; - } - - return new HashArrayMapNode(ownerID, newCount, newNodes); - }; - - - - - function HashCollisionNode(ownerID, keyHash, entries) { - this.ownerID = ownerID; - this.keyHash = keyHash; - this.entries = entries; - } - - HashCollisionNode.prototype.get = function(shift, keyHash, key, notSetValue) { - var entries = this.entries; - for (var ii = 0, len = entries.length; ii < len; ii++) { - if (is(key, entries[ii][0])) { - return entries[ii][1]; - } - } - return notSetValue; - }; - - HashCollisionNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { - if (keyHash === undefined) { - keyHash = hash(key); - } - - var removed = value === NOT_SET; - - if (keyHash !== this.keyHash) { - if (removed) { - return this; - } - SetRef(didAlter); - SetRef(didChangeSize); - return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]); - } - - var entries = this.entries; - var idx = 0; - for (var len = entries.length; idx < len; idx++) { - if (is(key, entries[idx][0])) { - break; - } - } - var exists = idx < len; - - if (exists ? entries[idx][1] === value : removed) { - return this; - } - - SetRef(didAlter); - (removed || !exists) && SetRef(didChangeSize); - - if (removed && len === 2) { - return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]); - } - - var isEditable = ownerID && ownerID === this.ownerID; - var newEntries = isEditable ? entries : arrCopy(entries); - - if (exists) { - if (removed) { - idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop()); - } else { - newEntries[idx] = [key, value]; - } - } else { - newEntries.push([key, value]); - } - - if (isEditable) { - this.entries = newEntries; - return this; - } - - return new HashCollisionNode(ownerID, this.keyHash, newEntries); - }; - - - - - function ValueNode(ownerID, keyHash, entry) { - this.ownerID = ownerID; - this.keyHash = keyHash; - this.entry = entry; - } - - ValueNode.prototype.get = function(shift, keyHash, key, notSetValue) { - return is(key, this.entry[0]) ? this.entry[1] : notSetValue; - }; - - ValueNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { - var removed = value === NOT_SET; - var keyMatch = is(key, this.entry[0]); - if (keyMatch ? value === this.entry[1] : removed) { - return this; - } - - SetRef(didAlter); - - if (removed) { - SetRef(didChangeSize); - return; // undefined - } - - if (keyMatch) { - if (ownerID && ownerID === this.ownerID) { - this.entry[1] = value; - return this; - } - return new ValueNode(ownerID, this.keyHash, [key, value]); - } - - SetRef(didChangeSize); - return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]); - }; - - - - // #pragma Iterators - - ArrayMapNode.prototype.iterate = - HashCollisionNode.prototype.iterate = function (fn, reverse) { - var entries = this.entries; - for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) { - if (fn(entries[reverse ? maxIndex - ii : ii]) === false) { - return false; - } - } - } - - BitmapIndexedNode.prototype.iterate = - HashArrayMapNode.prototype.iterate = function (fn, reverse) { - var nodes = this.nodes; - for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) { - var node = nodes[reverse ? maxIndex - ii : ii]; - if (node && node.iterate(fn, reverse) === false) { - return false; - } - } - } - - ValueNode.prototype.iterate = function (fn, reverse) { - return fn(this.entry); - } - - createClass(MapIterator, src_Iterator__Iterator); - - function MapIterator(map, type, reverse) { - this._type = type; - this._reverse = reverse; - this._stack = map._root && mapIteratorFrame(map._root); - } - - MapIterator.prototype.next = function() { - var type = this._type; - var stack = this._stack; - while (stack) { - var node = stack.node; - var index = stack.index++; - var maxIndex; - if (node.entry) { - if (index === 0) { - return mapIteratorValue(type, node.entry); - } - } else if (node.entries) { - maxIndex = node.entries.length - 1; - if (index <= maxIndex) { - return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]); - } - } else { - maxIndex = node.nodes.length - 1; - if (index <= maxIndex) { - var subNode = node.nodes[this._reverse ? maxIndex - index : index]; - if (subNode) { - if (subNode.entry) { - return mapIteratorValue(type, subNode.entry); - } - stack = this._stack = mapIteratorFrame(subNode, stack); - } - continue; - } - } - stack = this._stack = this._stack.__prev; - } - return iteratorDone(); - }; - - - function mapIteratorValue(type, entry) { - return iteratorValue(type, entry[0], entry[1]); - } - - function mapIteratorFrame(node, prev) { - return { - node: node, - index: 0, - __prev: prev - }; - } - - function makeMap(size, root, ownerID, hash) { - var map = Object.create(MapPrototype); - map.size = size; - map._root = root; - map.__ownerID = ownerID; - map.__hash = hash; - map.__altered = false; - return map; - } - - var EMPTY_MAP; - function emptyMap() { - return EMPTY_MAP || (EMPTY_MAP = makeMap(0)); - } - - function updateMap(map, k, v) { - var newRoot; - var newSize; - if (!map._root) { - if (v === NOT_SET) { - return map; - } - newSize = 1; - newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]); - } else { - var didChangeSize = MakeRef(CHANGE_LENGTH); - var didAlter = MakeRef(DID_ALTER); - newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter); - if (!didAlter.value) { - return map; - } - newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0); - } - if (map.__ownerID) { - map.size = newSize; - map._root = newRoot; - map.__hash = undefined; - map.__altered = true; - return map; - } - return newRoot ? makeMap(newSize, newRoot) : emptyMap(); - } - - function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { - if (!node) { - if (value === NOT_SET) { - return node; - } - SetRef(didAlter); - SetRef(didChangeSize); - return new ValueNode(ownerID, keyHash, [key, value]); - } - return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter); - } - - function isLeafNode(node) { - return node.constructor === ValueNode || node.constructor === HashCollisionNode; - } - - function mergeIntoNode(node, ownerID, shift, keyHash, entry) { - if (node.keyHash === keyHash) { - return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]); - } - - var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK; - var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; - - var newNode; - var nodes = idx1 === idx2 ? - [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] : - ((newNode = new ValueNode(ownerID, keyHash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]); - - return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes); - } - - function createNodes(ownerID, entries, key, value) { - if (!ownerID) { - ownerID = new OwnerID(); - } - var node = new ValueNode(ownerID, hash(key), [key, value]); - for (var ii = 0; ii < entries.length; ii++) { - var entry = entries[ii]; - node = node.update(ownerID, 0, undefined, entry[0], entry[1]); - } - return node; - } - - function packNodes(ownerID, nodes, count, excluding) { - var bitmap = 0; - var packedII = 0; - var packedNodes = new Array(count); - for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) { - var node = nodes[ii]; - if (node !== undefined && ii !== excluding) { - bitmap |= bit; - packedNodes[packedII++] = node; - } - } - return new BitmapIndexedNode(ownerID, bitmap, packedNodes); - } - - function expandNodes(ownerID, nodes, bitmap, including, node) { - var count = 0; - var expandedNodes = new Array(SIZE); - for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) { - expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined; - } - expandedNodes[including] = node; - return new HashArrayMapNode(ownerID, count + 1, expandedNodes); - } - - function mergeIntoMapWith(map, merger, iterables) { - var iters = []; - for (var ii = 0; ii < iterables.length; ii++) { - var value = iterables[ii]; - var iter = KeyedIterable(value); - if (!isIterable(value)) { - iter = iter.map(function(v ) {return fromJS(v)}); - } - iters.push(iter); - } - return mergeIntoCollectionWith(map, merger, iters); - } - - function deepMerger(merger) { - return function(existing, value, key) - {return existing && existing.mergeDeepWith && isIterable(value) ? - existing.mergeDeepWith(merger, value) : - merger ? merger(existing, value, key) : value}; - } - - function mergeIntoCollectionWith(collection, merger, iters) { - iters = iters.filter(function(x ) {return x.size !== 0}); - if (iters.length === 0) { - return collection; - } - if (collection.size === 0 && !collection.__ownerID && iters.length === 1) { - return collection.constructor(iters[0]); - } - return collection.withMutations(function(collection ) { - var mergeIntoMap = merger ? - function(value, key) { - collection.update(key, NOT_SET, function(existing ) - {return existing === NOT_SET ? value : merger(existing, value, key)} - ); - } : - function(value, key) { - collection.set(key, value); - } - for (var ii = 0; ii < iters.length; ii++) { - iters[ii].forEach(mergeIntoMap); - } - }); - } - - function updateInDeepMap(existing, keyPathIter, notSetValue, updater) { - var isNotSet = existing === NOT_SET; - var step = keyPathIter.next(); - if (step.done) { - var existingValue = isNotSet ? notSetValue : existing; - var newValue = updater(existingValue); - return newValue === existingValue ? existing : newValue; - } - invariant( - isNotSet || (existing && existing.set), - 'invalid keyPath' - ); - var key = step.value; - var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET); - var nextUpdated = updateInDeepMap( - nextExisting, - keyPathIter, - notSetValue, - updater - ); - return nextUpdated === nextExisting ? existing : - nextUpdated === NOT_SET ? existing.remove(key) : - (isNotSet ? emptyMap() : existing).set(key, nextUpdated); - } - - function popCount(x) { - x = x - ((x >> 1) & 0x55555555); - x = (x & 0x33333333) + ((x >> 2) & 0x33333333); - x = (x + (x >> 4)) & 0x0f0f0f0f; - x = x + (x >> 8); - x = x + (x >> 16); - return x & 0x7f; - } - - function setIn(array, idx, val, canEdit) { - var newArray = canEdit ? array : arrCopy(array); - newArray[idx] = val; - return newArray; - } - - function spliceIn(array, idx, val, canEdit) { - var newLen = array.length + 1; - if (canEdit && idx + 1 === newLen) { - array[idx] = val; - return array; - } - var newArray = new Array(newLen); - var after = 0; - for (var ii = 0; ii < newLen; ii++) { - if (ii === idx) { - newArray[ii] = val; - after = -1; - } else { - newArray[ii] = array[ii + after]; - } - } - return newArray; - } - - function spliceOut(array, idx, canEdit) { - var newLen = array.length - 1; - if (canEdit && idx === newLen) { - array.pop(); - return array; - } - var newArray = new Array(newLen); - var after = 0; - for (var ii = 0; ii < newLen; ii++) { - if (ii === idx) { - after = 1; - } - newArray[ii] = array[ii + after]; - } - return newArray; - } - - var MAX_ARRAY_MAP_SIZE = SIZE / 4; - var MAX_BITMAP_INDEXED_SIZE = SIZE / 2; - var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4; - - createClass(List, IndexedCollection); - - // @pragma Construction - - function List(value) { - var empty = emptyList(); - if (value === null || value === undefined) { - return empty; - } - if (isList(value)) { - return value; - } - var iter = IndexedIterable(value); - var size = iter.size; - if (size === 0) { - return empty; - } - assertNotInfinite(size); - if (size > 0 && size < SIZE) { - return makeList(0, size, SHIFT, null, new VNode(iter.toArray())); - } - return empty.withMutations(function(list ) { - list.setSize(size); - iter.forEach(function(v, i) {return list.set(i, v)}); - }); - } - - List.of = function(/*...values*/) { - return this(arguments); - }; - - List.prototype.toString = function() { - return this.__toString('List [', ']'); - }; - - // @pragma Access - - List.prototype.get = function(index, notSetValue) { - index = wrapIndex(this, index); - if (index < 0 || index >= this.size) { - return notSetValue; - } - index += this._origin; - var node = listNodeFor(this, index); - return node && node.array[index & MASK]; - }; - - // @pragma Modification - - List.prototype.set = function(index, value) { - return updateList(this, index, value); - }; - - List.prototype.remove = function(index) { - return !this.has(index) ? this : - index === 0 ? this.shift() : - index === this.size - 1 ? this.pop() : - this.splice(index, 1); - }; - - List.prototype.clear = function() { - if (this.size === 0) { - return this; - } - if (this.__ownerID) { - this.size = this._origin = this._capacity = 0; - this._level = SHIFT; - this._root = this._tail = null; - this.__hash = undefined; - this.__altered = true; - return this; - } - return emptyList(); - }; - - List.prototype.push = function(/*...values*/) { - var values = arguments; - var oldSize = this.size; - return this.withMutations(function(list ) { - setListBounds(list, 0, oldSize + values.length); - for (var ii = 0; ii < values.length; ii++) { - list.set(oldSize + ii, values[ii]); - } - }); - }; - - List.prototype.pop = function() { - return setListBounds(this, 0, -1); - }; - - List.prototype.unshift = function(/*...values*/) { - var values = arguments; - return this.withMutations(function(list ) { - setListBounds(list, -values.length); - for (var ii = 0; ii < values.length; ii++) { - list.set(ii, values[ii]); - } - }); - }; - - List.prototype.shift = function() { - return setListBounds(this, 1); - }; - - // @pragma Composition - - List.prototype.merge = function(/*...iters*/) { - return mergeIntoListWith(this, undefined, arguments); - }; - - List.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1); - return mergeIntoListWith(this, merger, iters); - }; - - List.prototype.mergeDeep = function(/*...iters*/) { - return mergeIntoListWith(this, deepMerger(undefined), arguments); - }; - - List.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1); - return mergeIntoListWith(this, deepMerger(merger), iters); - }; - - List.prototype.setSize = function(size) { - return setListBounds(this, 0, size); - }; - - // @pragma Iteration - - List.prototype.slice = function(begin, end) { - var size = this.size; - if (wholeSlice(begin, end, size)) { - return this; - } - return setListBounds( - this, - resolveBegin(begin, size), - resolveEnd(end, size) - ); - }; - - List.prototype.__iterator = function(type, reverse) { - var index = 0; - var values = iterateList(this, reverse); - return new src_Iterator__Iterator(function() { - var value = values(); - return value === DONE ? - iteratorDone() : - iteratorValue(type, index++, value); - }); - }; - - List.prototype.__iterate = function(fn, reverse) { - var index = 0; - var values = iterateList(this, reverse); - var value; - while ((value = values()) !== DONE) { - if (fn(value, index++, this) === false) { - break; - } - } - return index; - }; - - List.prototype.__ensureOwner = function(ownerID) { - if (ownerID === this.__ownerID) { - return this; - } - if (!ownerID) { - this.__ownerID = ownerID; - return this; - } - return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash); - }; - - - function isList(maybeList) { - return !!(maybeList && maybeList[IS_LIST_SENTINEL]); - } - - List.isList = isList; - - var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@'; - - var ListPrototype = List.prototype; - ListPrototype[IS_LIST_SENTINEL] = true; - ListPrototype[DELETE] = ListPrototype.remove; - ListPrototype.setIn = MapPrototype.setIn; - ListPrototype.deleteIn = - ListPrototype.removeIn = MapPrototype.removeIn; - ListPrototype.update = MapPrototype.update; - ListPrototype.updateIn = MapPrototype.updateIn; - ListPrototype.mergeIn = MapPrototype.mergeIn; - ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn; - ListPrototype.withMutations = MapPrototype.withMutations; - ListPrototype.asMutable = MapPrototype.asMutable; - ListPrototype.asImmutable = MapPrototype.asImmutable; - ListPrototype.wasAltered = MapPrototype.wasAltered; - - - - function VNode(array, ownerID) { - this.array = array; - this.ownerID = ownerID; - } - - // TODO: seems like these methods are very similar - - VNode.prototype.removeBefore = function(ownerID, level, index) { - if (index === level ? 1 << level : 0 || this.array.length === 0) { - return this; - } - var originIndex = (index >>> level) & MASK; - if (originIndex >= this.array.length) { - return new VNode([], ownerID); - } - var removingFirst = originIndex === 0; - var newChild; - if (level > 0) { - var oldChild = this.array[originIndex]; - newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index); - if (newChild === oldChild && removingFirst) { - return this; - } - } - if (removingFirst && !newChild) { - return this; - } - var editable = editableVNode(this, ownerID); - if (!removingFirst) { - for (var ii = 0; ii < originIndex; ii++) { - editable.array[ii] = undefined; - } - } - if (newChild) { - editable.array[originIndex] = newChild; - } - return editable; - }; - - VNode.prototype.removeAfter = function(ownerID, level, index) { - if (index === level ? 1 << level : 0 || this.array.length === 0) { - return this; - } - var sizeIndex = ((index - 1) >>> level) & MASK; - if (sizeIndex >= this.array.length) { - return this; - } - var removingLast = sizeIndex === this.array.length - 1; - var newChild; - if (level > 0) { - var oldChild = this.array[sizeIndex]; - newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index); - if (newChild === oldChild && removingLast) { - return this; - } - } - if (removingLast && !newChild) { - return this; - } - var editable = editableVNode(this, ownerID); - if (!removingLast) { - editable.array.pop(); - } - if (newChild) { - editable.array[sizeIndex] = newChild; - } - return editable; - }; - - - - var DONE = {}; - - function iterateList(list, reverse) { - var left = list._origin; - var right = list._capacity; - var tailPos = getTailOffset(right); - var tail = list._tail; - - return iterateNodeOrLeaf(list._root, list._level, 0); - - function iterateNodeOrLeaf(node, level, offset) { - return level === 0 ? - iterateLeaf(node, offset) : - iterateNode(node, level, offset); - } - - function iterateLeaf(node, offset) { - var array = offset === tailPos ? tail && tail.array : node && node.array; - var from = offset > left ? 0 : left - offset; - var to = right - offset; - if (to > SIZE) { - to = SIZE; - } - return function() { - if (from === to) { - return DONE; - } - var idx = reverse ? --to : from++; - return array && array[idx]; - }; - } - - function iterateNode(node, level, offset) { - var values; - var array = node && node.array; - var from = offset > left ? 0 : (left - offset) >> level; - var to = ((right - offset) >> level) + 1; - if (to > SIZE) { - to = SIZE; - } - return function() { - do { - if (values) { - var value = values(); - if (value !== DONE) { - return value; - } - values = null; - } - if (from === to) { - return DONE; - } - var idx = reverse ? --to : from++; - values = iterateNodeOrLeaf( - array && array[idx], level - SHIFT, offset + (idx << level) - ); - } while (true); - }; - } - } - - function makeList(origin, capacity, level, root, tail, ownerID, hash) { - var list = Object.create(ListPrototype); - list.size = capacity - origin; - list._origin = origin; - list._capacity = capacity; - list._level = level; - list._root = root; - list._tail = tail; - list.__ownerID = ownerID; - list.__hash = hash; - list.__altered = false; - return list; - } - - var EMPTY_LIST; - function emptyList() { - return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT)); - } - - function updateList(list, index, value) { - index = wrapIndex(list, index); - - if (index >= list.size || index < 0) { - return list.withMutations(function(list ) { - index < 0 ? - setListBounds(list, index).set(0, value) : - setListBounds(list, 0, index + 1).set(index, value) - }); - } - - index += list._origin; - - var newTail = list._tail; - var newRoot = list._root; - var didAlter = MakeRef(DID_ALTER); - if (index >= getTailOffset(list._capacity)) { - newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter); - } else { - newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter); - } - - if (!didAlter.value) { - return list; - } - - if (list.__ownerID) { - list._root = newRoot; - list._tail = newTail; - list.__hash = undefined; - list.__altered = true; - return list; - } - return makeList(list._origin, list._capacity, list._level, newRoot, newTail); - } - - function updateVNode(node, ownerID, level, index, value, didAlter) { - var idx = (index >>> level) & MASK; - var nodeHas = node && idx < node.array.length; - if (!nodeHas && value === undefined) { - return node; - } - - var newNode; - - if (level > 0) { - var lowerNode = node && node.array[idx]; - var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter); - if (newLowerNode === lowerNode) { - return node; - } - newNode = editableVNode(node, ownerID); - newNode.array[idx] = newLowerNode; - return newNode; - } - - if (nodeHas && node.array[idx] === value) { - return node; - } - - SetRef(didAlter); - - newNode = editableVNode(node, ownerID); - if (value === undefined && idx === newNode.array.length - 1) { - newNode.array.pop(); - } else { - newNode.array[idx] = value; - } - return newNode; - } - - function editableVNode(node, ownerID) { - if (ownerID && node && ownerID === node.ownerID) { - return node; - } - return new VNode(node ? node.array.slice() : [], ownerID); - } - - function listNodeFor(list, rawIndex) { - if (rawIndex >= getTailOffset(list._capacity)) { - return list._tail; - } - if (rawIndex < 1 << (list._level + SHIFT)) { - var node = list._root; - var level = list._level; - while (node && level > 0) { - node = node.array[(rawIndex >>> level) & MASK]; - level -= SHIFT; - } - return node; - } - } - - function setListBounds(list, begin, end) { - var owner = list.__ownerID || new OwnerID(); - var oldOrigin = list._origin; - var oldCapacity = list._capacity; - var newOrigin = oldOrigin + begin; - var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end; - if (newOrigin === oldOrigin && newCapacity === oldCapacity) { - return list; - } - - // If it's going to end after it starts, it's empty. - if (newOrigin >= newCapacity) { - return list.clear(); - } - - var newLevel = list._level; - var newRoot = list._root; - - // New origin might require creating a higher root. - var offsetShift = 0; - while (newOrigin + offsetShift < 0) { - newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner); - newLevel += SHIFT; - offsetShift += 1 << newLevel; - } - if (offsetShift) { - newOrigin += offsetShift; - oldOrigin += offsetShift; - newCapacity += offsetShift; - oldCapacity += offsetShift; - } - - var oldTailOffset = getTailOffset(oldCapacity); - var newTailOffset = getTailOffset(newCapacity); - - // New size might require creating a higher root. - while (newTailOffset >= 1 << (newLevel + SHIFT)) { - newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner); - newLevel += SHIFT; - } - - // Locate or create the new tail. - var oldTail = list._tail; - var newTail = newTailOffset < oldTailOffset ? - listNodeFor(list, newCapacity - 1) : - newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail; - - // Merge Tail into tree. - if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) { - newRoot = editableVNode(newRoot, owner); - var node = newRoot; - for (var level = newLevel; level > SHIFT; level -= SHIFT) { - var idx = (oldTailOffset >>> level) & MASK; - node = node.array[idx] = editableVNode(node.array[idx], owner); - } - node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail; - } - - // If the size has been reduced, there's a chance the tail needs to be trimmed. - if (newCapacity < oldCapacity) { - newTail = newTail && newTail.removeAfter(owner, 0, newCapacity); - } - - // If the new origin is within the tail, then we do not need a root. - if (newOrigin >= newTailOffset) { - newOrigin -= newTailOffset; - newCapacity -= newTailOffset; - newLevel = SHIFT; - newRoot = null; - newTail = newTail && newTail.removeBefore(owner, 0, newOrigin); - - // Otherwise, if the root has been trimmed, garbage collect. - } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) { - offsetShift = 0; - - // Identify the new top root node of the subtree of the old root. - while (newRoot) { - var beginIndex = (newOrigin >>> newLevel) & MASK; - if (beginIndex !== (newTailOffset >>> newLevel) & MASK) { - break; - } - if (beginIndex) { - offsetShift += (1 << newLevel) * beginIndex; - } - newLevel -= SHIFT; - newRoot = newRoot.array[beginIndex]; - } - - // Trim the new sides of the new root. - if (newRoot && newOrigin > oldOrigin) { - newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift); - } - if (newRoot && newTailOffset < oldTailOffset) { - newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift); - } - if (offsetShift) { - newOrigin -= offsetShift; - newCapacity -= offsetShift; - } - } - - if (list.__ownerID) { - list.size = newCapacity - newOrigin; - list._origin = newOrigin; - list._capacity = newCapacity; - list._level = newLevel; - list._root = newRoot; - list._tail = newTail; - list.__hash = undefined; - list.__altered = true; - return list; - } - return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail); - } - - function mergeIntoListWith(list, merger, iterables) { - var iters = []; - var maxSize = 0; - for (var ii = 0; ii < iterables.length; ii++) { - var value = iterables[ii]; - var iter = IndexedIterable(value); - if (iter.size > maxSize) { - maxSize = iter.size; - } - if (!isIterable(value)) { - iter = iter.map(function(v ) {return fromJS(v)}); - } - iters.push(iter); - } - if (maxSize > list.size) { - list = list.setSize(maxSize); - } - return mergeIntoCollectionWith(list, merger, iters); - } - - function getTailOffset(size) { - return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT); - } - - createClass(OrderedMap, src_Map__Map); - - // @pragma Construction - - function OrderedMap(value) { - return value === null || value === undefined ? emptyOrderedMap() : - isOrderedMap(value) ? value : - emptyOrderedMap().withMutations(function(map ) { - var iter = KeyedIterable(value); - assertNotInfinite(iter.size); - iter.forEach(function(v, k) {return map.set(k, v)}); - }); - } - - OrderedMap.of = function(/*...values*/) { - return this(arguments); - }; - - OrderedMap.prototype.toString = function() { - return this.__toString('OrderedMap {', '}'); - }; - - // @pragma Access - - OrderedMap.prototype.get = function(k, notSetValue) { - var index = this._map.get(k); - return index !== undefined ? this._list.get(index)[1] : notSetValue; - }; - - // @pragma Modification - - OrderedMap.prototype.clear = function() { - if (this.size === 0) { - return this; - } - if (this.__ownerID) { - this.size = 0; - this._map.clear(); - this._list.clear(); - return this; - } - return emptyOrderedMap(); - }; - - OrderedMap.prototype.set = function(k, v) { - return updateOrderedMap(this, k, v); - }; - - OrderedMap.prototype.remove = function(k) { - return updateOrderedMap(this, k, NOT_SET); - }; - - OrderedMap.prototype.wasAltered = function() { - return this._map.wasAltered() || this._list.wasAltered(); - }; - - OrderedMap.prototype.__iterate = function(fn, reverse) {var this$0 = this; - return this._list.__iterate( - function(entry ) {return entry && fn(entry[1], entry[0], this$0)}, - reverse - ); - }; - - OrderedMap.prototype.__iterator = function(type, reverse) { - return this._list.fromEntrySeq().__iterator(type, reverse); - }; - - OrderedMap.prototype.__ensureOwner = function(ownerID) { - if (ownerID === this.__ownerID) { - return this; - } - var newMap = this._map.__ensureOwner(ownerID); - var newList = this._list.__ensureOwner(ownerID); - if (!ownerID) { - this.__ownerID = ownerID; - this._map = newMap; - this._list = newList; - return this; - } - return makeOrderedMap(newMap, newList, ownerID, this.__hash); - }; - - - function isOrderedMap(maybeOrderedMap) { - return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap); - } - - OrderedMap.isOrderedMap = isOrderedMap; - - OrderedMap.prototype[IS_ORDERED_SENTINEL] = true; - OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove; - - - - function makeOrderedMap(map, list, ownerID, hash) { - var omap = Object.create(OrderedMap.prototype); - omap.size = map ? map.size : 0; - omap._map = map; - omap._list = list; - omap.__ownerID = ownerID; - omap.__hash = hash; - return omap; - } - - var EMPTY_ORDERED_MAP; - function emptyOrderedMap() { - return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList())); - } - - function updateOrderedMap(omap, k, v) { - var map = omap._map; - var list = omap._list; - var i = map.get(k); - var has = i !== undefined; - var newMap; - var newList; - if (v === NOT_SET) { // removed - if (!has) { - return omap; - } - if (list.size >= SIZE && list.size >= map.size * 2) { - newList = list.filter(function(entry, idx) {return entry !== undefined && i !== idx}); - newMap = newList.toKeyedSeq().map(function(entry ) {return entry[0]}).flip().toMap(); - if (omap.__ownerID) { - newMap.__ownerID = newList.__ownerID = omap.__ownerID; - } - } else { - newMap = map.remove(k); - newList = i === list.size - 1 ? list.pop() : list.set(i, undefined); - } - } else { - if (has) { - if (v === list.get(i)[1]) { - return omap; - } - newMap = map; - newList = list.set(i, [k, v]); - } else { - newMap = map.set(k, list.size); - newList = list.set(list.size, [k, v]); - } - } - if (omap.__ownerID) { - omap.size = newMap.size; - omap._map = newMap; - omap._list = newList; - omap.__hash = undefined; - return omap; - } - return makeOrderedMap(newMap, newList); - } - - createClass(Stack, IndexedCollection); - - // @pragma Construction - - function Stack(value) { - return value === null || value === undefined ? emptyStack() : - isStack(value) ? value : - emptyStack().unshiftAll(value); - } - - Stack.of = function(/*...values*/) { - return this(arguments); - }; - - Stack.prototype.toString = function() { - return this.__toString('Stack [', ']'); - }; - - // @pragma Access - - Stack.prototype.get = function(index, notSetValue) { - var head = this._head; - index = wrapIndex(this, index); - while (head && index--) { - head = head.next; - } - return head ? head.value : notSetValue; - }; - - Stack.prototype.peek = function() { - return this._head && this._head.value; - }; - - // @pragma Modification - - Stack.prototype.push = function(/*...values*/) { - if (arguments.length === 0) { - return this; - } - var newSize = this.size + arguments.length; - var head = this._head; - for (var ii = arguments.length - 1; ii >= 0; ii--) { - head = { - value: arguments[ii], - next: head - }; - } - if (this.__ownerID) { - this.size = newSize; - this._head = head; - this.__hash = undefined; - this.__altered = true; - return this; - } - return makeStack(newSize, head); - }; - - Stack.prototype.pushAll = function(iter) { - iter = IndexedIterable(iter); - if (iter.size === 0) { - return this; - } - assertNotInfinite(iter.size); - var newSize = this.size; - var head = this._head; - iter.reverse().forEach(function(value ) { - newSize++; - head = { - value: value, - next: head - }; - }); - if (this.__ownerID) { - this.size = newSize; - this._head = head; - this.__hash = undefined; - this.__altered = true; - return this; - } - return makeStack(newSize, head); - }; - - Stack.prototype.pop = function() { - return this.slice(1); - }; - - Stack.prototype.unshift = function(/*...values*/) { - return this.push.apply(this, arguments); - }; - - Stack.prototype.unshiftAll = function(iter) { - return this.pushAll(iter); - }; - - Stack.prototype.shift = function() { - return this.pop.apply(this, arguments); - }; - - Stack.prototype.clear = function() { - if (this.size === 0) { - return this; - } - if (this.__ownerID) { - this.size = 0; - this._head = undefined; - this.__hash = undefined; - this.__altered = true; - return this; - } - return emptyStack(); - }; - - Stack.prototype.slice = function(begin, end) { - if (wholeSlice(begin, end, this.size)) { - return this; - } - var resolvedBegin = resolveBegin(begin, this.size); - var resolvedEnd = resolveEnd(end, this.size); - if (resolvedEnd !== this.size) { - // super.slice(begin, end); - return IndexedCollection.prototype.slice.call(this, begin, end); - } - var newSize = this.size - resolvedBegin; - var head = this._head; - while (resolvedBegin--) { - head = head.next; - } - if (this.__ownerID) { - this.size = newSize; - this._head = head; - this.__hash = undefined; - this.__altered = true; - return this; - } - return makeStack(newSize, head); - }; - - // @pragma Mutability - - Stack.prototype.__ensureOwner = function(ownerID) { - if (ownerID === this.__ownerID) { - return this; - } - if (!ownerID) { - this.__ownerID = ownerID; - this.__altered = false; - return this; - } - return makeStack(this.size, this._head, ownerID, this.__hash); - }; - - // @pragma Iteration - - Stack.prototype.__iterate = function(fn, reverse) { - if (reverse) { - return this.reverse().__iterate(fn); - } - var iterations = 0; - var node = this._head; - while (node) { - if (fn(node.value, iterations++, this) === false) { - break; - } - node = node.next; - } - return iterations; - }; - - Stack.prototype.__iterator = function(type, reverse) { - if (reverse) { - return this.reverse().__iterator(type); - } - var iterations = 0; - var node = this._head; - return new src_Iterator__Iterator(function() { - if (node) { - var value = node.value; - node = node.next; - return iteratorValue(type, iterations++, value); - } - return iteratorDone(); - }); - }; - - - function isStack(maybeStack) { - return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]); - } - - Stack.isStack = isStack; - - var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@'; - - var StackPrototype = Stack.prototype; - StackPrototype[IS_STACK_SENTINEL] = true; - StackPrototype.withMutations = MapPrototype.withMutations; - StackPrototype.asMutable = MapPrototype.asMutable; - StackPrototype.asImmutable = MapPrototype.asImmutable; - StackPrototype.wasAltered = MapPrototype.wasAltered; - - - function makeStack(size, head, ownerID, hash) { - var map = Object.create(StackPrototype); - map.size = size; - map._head = head; - map.__ownerID = ownerID; - map.__hash = hash; - map.__altered = false; - return map; - } - - var EMPTY_STACK; - function emptyStack() { - return EMPTY_STACK || (EMPTY_STACK = makeStack(0)); - } - - createClass(src_Set__Set, SetCollection); - - // @pragma Construction - - function src_Set__Set(value) { - return value === null || value === undefined ? emptySet() : - isSet(value) ? value : - emptySet().withMutations(function(set ) { - var iter = SetIterable(value); - assertNotInfinite(iter.size); - iter.forEach(function(v ) {return set.add(v)}); - }); - } - - src_Set__Set.of = function(/*...values*/) { - return this(arguments); - }; - - src_Set__Set.fromKeys = function(value) { - return this(KeyedIterable(value).keySeq()); - }; - - src_Set__Set.prototype.toString = function() { - return this.__toString('Set {', '}'); - }; - - // @pragma Access - - src_Set__Set.prototype.has = function(value) { - return this._map.has(value); - }; - - // @pragma Modification - - src_Set__Set.prototype.add = function(value) { - return updateSet(this, this._map.set(value, true)); - }; - - src_Set__Set.prototype.remove = function(value) { - return updateSet(this, this._map.remove(value)); - }; - - src_Set__Set.prototype.clear = function() { - return updateSet(this, this._map.clear()); - }; - - // @pragma Composition - - src_Set__Set.prototype.union = function() {var iters = SLICE$0.call(arguments, 0); - iters = iters.filter(function(x ) {return x.size !== 0}); - if (iters.length === 0) { - return this; - } - if (this.size === 0 && !this.__ownerID && iters.length === 1) { - return this.constructor(iters[0]); - } - return this.withMutations(function(set ) { - for (var ii = 0; ii < iters.length; ii++) { - SetIterable(iters[ii]).forEach(function(value ) {return set.add(value)}); - } - }); - }; - - src_Set__Set.prototype.intersect = function() {var iters = SLICE$0.call(arguments, 0); - if (iters.length === 0) { - return this; - } - iters = iters.map(function(iter ) {return SetIterable(iter)}); - var originalSet = this; - return this.withMutations(function(set ) { - originalSet.forEach(function(value ) { - if (!iters.every(function(iter ) {return iter.includes(value)})) { - set.remove(value); - } - }); - }); - }; - - src_Set__Set.prototype.subtract = function() {var iters = SLICE$0.call(arguments, 0); - if (iters.length === 0) { - return this; - } - iters = iters.map(function(iter ) {return SetIterable(iter)}); - var originalSet = this; - return this.withMutations(function(set ) { - originalSet.forEach(function(value ) { - if (iters.some(function(iter ) {return iter.includes(value)})) { - set.remove(value); - } - }); - }); - }; - - src_Set__Set.prototype.merge = function() { - return this.union.apply(this, arguments); - }; - - src_Set__Set.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1); - return this.union.apply(this, iters); - }; - - src_Set__Set.prototype.sort = function(comparator) { - // Late binding - return OrderedSet(sortFactory(this, comparator)); - }; - - src_Set__Set.prototype.sortBy = function(mapper, comparator) { - // Late binding - return OrderedSet(sortFactory(this, comparator, mapper)); - }; - - src_Set__Set.prototype.wasAltered = function() { - return this._map.wasAltered(); - }; - - src_Set__Set.prototype.__iterate = function(fn, reverse) {var this$0 = this; - return this._map.__iterate(function(_, k) {return fn(k, k, this$0)}, reverse); - }; - - src_Set__Set.prototype.__iterator = function(type, reverse) { - return this._map.map(function(_, k) {return k}).__iterator(type, reverse); - }; - - src_Set__Set.prototype.__ensureOwner = function(ownerID) { - if (ownerID === this.__ownerID) { - return this; - } - var newMap = this._map.__ensureOwner(ownerID); - if (!ownerID) { - this.__ownerID = ownerID; - this._map = newMap; - return this; - } - return this.__make(newMap, ownerID); - }; - - - function isSet(maybeSet) { - return !!(maybeSet && maybeSet[IS_SET_SENTINEL]); - } - - src_Set__Set.isSet = isSet; - - var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@'; - - var SetPrototype = src_Set__Set.prototype; - SetPrototype[IS_SET_SENTINEL] = true; - SetPrototype[DELETE] = SetPrototype.remove; - SetPrototype.mergeDeep = SetPrototype.merge; - SetPrototype.mergeDeepWith = SetPrototype.mergeWith; - SetPrototype.withMutations = MapPrototype.withMutations; - SetPrototype.asMutable = MapPrototype.asMutable; - SetPrototype.asImmutable = MapPrototype.asImmutable; - - SetPrototype.__empty = emptySet; - SetPrototype.__make = makeSet; - - function updateSet(set, newMap) { - if (set.__ownerID) { - set.size = newMap.size; - set._map = newMap; - return set; - } - return newMap === set._map ? set : - newMap.size === 0 ? set.__empty() : - set.__make(newMap); - } - - function makeSet(map, ownerID) { - var set = Object.create(SetPrototype); - set.size = map ? map.size : 0; - set._map = map; - set.__ownerID = ownerID; - return set; - } - - var EMPTY_SET; - function emptySet() { - return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap())); - } - - createClass(OrderedSet, src_Set__Set); - - // @pragma Construction - - function OrderedSet(value) { - return value === null || value === undefined ? emptyOrderedSet() : - isOrderedSet(value) ? value : - emptyOrderedSet().withMutations(function(set ) { - var iter = SetIterable(value); - assertNotInfinite(iter.size); - iter.forEach(function(v ) {return set.add(v)}); - }); - } - - OrderedSet.of = function(/*...values*/) { - return this(arguments); - }; - - OrderedSet.fromKeys = function(value) { - return this(KeyedIterable(value).keySeq()); - }; - - OrderedSet.prototype.toString = function() { - return this.__toString('OrderedSet {', '}'); - }; - - - function isOrderedSet(maybeOrderedSet) { - return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet); - } - - OrderedSet.isOrderedSet = isOrderedSet; - - var OrderedSetPrototype = OrderedSet.prototype; - OrderedSetPrototype[IS_ORDERED_SENTINEL] = true; - - OrderedSetPrototype.__empty = emptyOrderedSet; - OrderedSetPrototype.__make = makeOrderedSet; - - function makeOrderedSet(map, ownerID) { - var set = Object.create(OrderedSetPrototype); - set.size = map ? map.size : 0; - set._map = map; - set.__ownerID = ownerID; - return set; - } - - var EMPTY_ORDERED_SET; - function emptyOrderedSet() { - return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap())); - } - - createClass(Record, KeyedCollection); - - function Record(defaultValues, name) { - var hasInitialized; - - var RecordType = function Record(values) { - if (values instanceof RecordType) { - return values; - } - if (!(this instanceof RecordType)) { - return new RecordType(values); - } - if (!hasInitialized) { - hasInitialized = true; - var keys = Object.keys(defaultValues); - setProps(RecordTypePrototype, keys); - RecordTypePrototype.size = keys.length; - RecordTypePrototype._name = name; - RecordTypePrototype._keys = keys; - RecordTypePrototype._defaultValues = defaultValues; - } - this._map = src_Map__Map(values); - }; - - var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype); - RecordTypePrototype.constructor = RecordType; - - return RecordType; - } - - Record.prototype.toString = function() { - return this.__toString(recordName(this) + ' {', '}'); - }; - - // @pragma Access - - Record.prototype.has = function(k) { - return this._defaultValues.hasOwnProperty(k); - }; - - Record.prototype.get = function(k, notSetValue) { - if (!this.has(k)) { - return notSetValue; - } - var defaultVal = this._defaultValues[k]; - return this._map ? this._map.get(k, defaultVal) : defaultVal; - }; - - // @pragma Modification - - Record.prototype.clear = function() { - if (this.__ownerID) { - this._map && this._map.clear(); - return this; - } - var RecordType = this.constructor; - return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap())); - }; - - Record.prototype.set = function(k, v) { - if (!this.has(k)) { - throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this)); - } - var newMap = this._map && this._map.set(k, v); - if (this.__ownerID || newMap === this._map) { - return this; - } - return makeRecord(this, newMap); - }; - - Record.prototype.remove = function(k) { - if (!this.has(k)) { - return this; - } - var newMap = this._map && this._map.remove(k); - if (this.__ownerID || newMap === this._map) { - return this; - } - return makeRecord(this, newMap); - }; - - Record.prototype.wasAltered = function() { - return this._map.wasAltered(); - }; - - Record.prototype.__iterator = function(type, reverse) {var this$0 = this; - return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterator(type, reverse); - }; - - Record.prototype.__iterate = function(fn, reverse) {var this$0 = this; - return KeyedIterable(this._defaultValues).map(function(_, k) {return this$0.get(k)}).__iterate(fn, reverse); - }; - - Record.prototype.__ensureOwner = function(ownerID) { - if (ownerID === this.__ownerID) { - return this; - } - var newMap = this._map && this._map.__ensureOwner(ownerID); - if (!ownerID) { - this.__ownerID = ownerID; - this._map = newMap; - return this; - } - return makeRecord(this, newMap, ownerID); - }; - - - var RecordPrototype = Record.prototype; - RecordPrototype[DELETE] = RecordPrototype.remove; - RecordPrototype.deleteIn = - RecordPrototype.removeIn = MapPrototype.removeIn; - RecordPrototype.merge = MapPrototype.merge; - RecordPrototype.mergeWith = MapPrototype.mergeWith; - RecordPrototype.mergeIn = MapPrototype.mergeIn; - RecordPrototype.mergeDeep = MapPrototype.mergeDeep; - RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith; - RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn; - RecordPrototype.setIn = MapPrototype.setIn; - RecordPrototype.update = MapPrototype.update; - RecordPrototype.updateIn = MapPrototype.updateIn; - RecordPrototype.withMutations = MapPrototype.withMutations; - RecordPrototype.asMutable = MapPrototype.asMutable; - RecordPrototype.asImmutable = MapPrototype.asImmutable; - - - function makeRecord(likeRecord, map, ownerID) { - var record = Object.create(Object.getPrototypeOf(likeRecord)); - record._map = map; - record.__ownerID = ownerID; - return record; - } - - function recordName(record) { - return record._name || record.constructor.name || 'Record'; - } - - function setProps(prototype, names) { - try { - names.forEach(setProp.bind(undefined, prototype)); - } catch (error) { - // Object.defineProperty failed. Probably IE8. - } - } - - function setProp(prototype, name) { - Object.defineProperty(prototype, name, { - get: function() { - return this.get(name); - }, - set: function(value) { - invariant(this.__ownerID, 'Cannot set on an immutable record.'); - this.set(name, value); - } - }); - } - - function deepEqual(a, b) { - if (a === b) { - return true; - } - - if ( - !isIterable(b) || - a.size !== undefined && b.size !== undefined && a.size !== b.size || - a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash || - isKeyed(a) !== isKeyed(b) || - isIndexed(a) !== isIndexed(b) || - isOrdered(a) !== isOrdered(b) - ) { - return false; - } - - if (a.size === 0 && b.size === 0) { - return true; - } - - var notAssociative = !isAssociative(a); - - if (isOrdered(a)) { - var entries = a.entries(); - return b.every(function(v, k) { - var entry = entries.next().value; - return entry && is(entry[1], v) && (notAssociative || is(entry[0], k)); - }) && entries.next().done; - } - - var flipped = false; - - if (a.size === undefined) { - if (b.size === undefined) { - if (typeof a.cacheResult === 'function') { - a.cacheResult(); - } - } else { - flipped = true; - var _ = a; - a = b; - b = _; - } - } - - var allEqual = true; - var bSize = b.__iterate(function(v, k) { - if (notAssociative ? !a.has(v) : - flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) { - allEqual = false; - return false; - } - }); - - return allEqual && a.size === bSize; - } - - createClass(Range, IndexedSeq); - - function Range(start, end, step) { - if (!(this instanceof Range)) { - return new Range(start, end, step); - } - invariant(step !== 0, 'Cannot step a Range by 0'); - start = start || 0; - if (end === undefined) { - end = Infinity; - } - step = step === undefined ? 1 : Math.abs(step); - if (end < start) { - step = -step; - } - this._start = start; - this._end = end; - this._step = step; - this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1); - if (this.size === 0) { - if (EMPTY_RANGE) { - return EMPTY_RANGE; - } - EMPTY_RANGE = this; - } - } - - Range.prototype.toString = function() { - if (this.size === 0) { - return 'Range []'; - } - return 'Range [ ' + - this._start + '...' + this._end + - (this._step > 1 ? ' by ' + this._step : '') + - ' ]'; - }; - - Range.prototype.get = function(index, notSetValue) { - return this.has(index) ? - this._start + wrapIndex(this, index) * this._step : - notSetValue; - }; - - Range.prototype.includes = function(searchValue) { - var possibleIndex = (searchValue - this._start) / this._step; - return possibleIndex >= 0 && - possibleIndex < this.size && - possibleIndex === Math.floor(possibleIndex); - }; - - Range.prototype.slice = function(begin, end) { - if (wholeSlice(begin, end, this.size)) { - return this; - } - begin = resolveBegin(begin, this.size); - end = resolveEnd(end, this.size); - if (end <= begin) { - return new Range(0, 0); - } - return new Range(this.get(begin, this._end), this.get(end, this._end), this._step); - }; - - Range.prototype.indexOf = function(searchValue) { - var offsetValue = searchValue - this._start; - if (offsetValue % this._step === 0) { - var index = offsetValue / this._step; - if (index >= 0 && index < this.size) { - return index - } - } - return -1; - }; - - Range.prototype.lastIndexOf = function(searchValue) { - return this.indexOf(searchValue); - }; - - Range.prototype.__iterate = function(fn, reverse) { - var maxIndex = this.size - 1; - var step = this._step; - var value = reverse ? this._start + maxIndex * step : this._start; - for (var ii = 0; ii <= maxIndex; ii++) { - if (fn(value, ii, this) === false) { - return ii + 1; - } - value += reverse ? -step : step; - } - return ii; - }; - - Range.prototype.__iterator = function(type, reverse) { - var maxIndex = this.size - 1; - var step = this._step; - var value = reverse ? this._start + maxIndex * step : this._start; - var ii = 0; - return new src_Iterator__Iterator(function() { - var v = value; - value += reverse ? -step : step; - return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v); - }); - }; - - Range.prototype.equals = function(other) { - return other instanceof Range ? - this._start === other._start && - this._end === other._end && - this._step === other._step : - deepEqual(this, other); - }; - - - var EMPTY_RANGE; - - createClass(Repeat, IndexedSeq); - - function Repeat(value, times) { - if (!(this instanceof Repeat)) { - return new Repeat(value, times); - } - this._value = value; - this.size = times === undefined ? Infinity : Math.max(0, times); - if (this.size === 0) { - if (EMPTY_REPEAT) { - return EMPTY_REPEAT; - } - EMPTY_REPEAT = this; - } - } - - Repeat.prototype.toString = function() { - if (this.size === 0) { - return 'Repeat []'; - } - return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]'; - }; - - Repeat.prototype.get = function(index, notSetValue) { - return this.has(index) ? this._value : notSetValue; - }; - - Repeat.prototype.includes = function(searchValue) { - return is(this._value, searchValue); - }; - - Repeat.prototype.slice = function(begin, end) { - var size = this.size; - return wholeSlice(begin, end, size) ? this : - new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size)); - }; - - Repeat.prototype.reverse = function() { - return this; - }; - - Repeat.prototype.indexOf = function(searchValue) { - if (is(this._value, searchValue)) { - return 0; - } - return -1; - }; - - Repeat.prototype.lastIndexOf = function(searchValue) { - if (is(this._value, searchValue)) { - return this.size; - } - return -1; - }; - - Repeat.prototype.__iterate = function(fn, reverse) { - for (var ii = 0; ii < this.size; ii++) { - if (fn(this._value, ii, this) === false) { - return ii + 1; - } - } - return ii; - }; - - Repeat.prototype.__iterator = function(type, reverse) {var this$0 = this; - var ii = 0; - return new src_Iterator__Iterator(function() - {return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone()} - ); - }; - - Repeat.prototype.equals = function(other) { - return other instanceof Repeat ? - is(this._value, other._value) : - deepEqual(other); - }; - - - var EMPTY_REPEAT; - - /** - * Contributes additional methods to a constructor - */ - function mixin(ctor, methods) { - var keyCopier = function(key ) { ctor.prototype[key] = methods[key]; }; - Object.keys(methods).forEach(keyCopier); - Object.getOwnPropertySymbols && - Object.getOwnPropertySymbols(methods).forEach(keyCopier); - return ctor; - } - - Iterable.Iterator = src_Iterator__Iterator; - - mixin(Iterable, { - - // ### Conversion to other types - - toArray: function() { - assertNotInfinite(this.size); - var array = new Array(this.size || 0); - this.valueSeq().__iterate(function(v, i) { array[i] = v; }); - return array; - }, - - toIndexedSeq: function() { - return new ToIndexedSequence(this); - }, - - toJS: function() { - return this.toSeq().map( - function(value ) {return value && typeof value.toJS === 'function' ? value.toJS() : value} - ).__toJS(); - }, - - toJSON: function() { - return this.toSeq().map( - function(value ) {return value && typeof value.toJSON === 'function' ? value.toJSON() : value} - ).__toJS(); - }, - - toKeyedSeq: function() { - return new ToKeyedSequence(this, true); - }, - - toMap: function() { - // Use Late Binding here to solve the circular dependency. - return src_Map__Map(this.toKeyedSeq()); - }, - - toObject: function() { - assertNotInfinite(this.size); - var object = {}; - this.__iterate(function(v, k) { object[k] = v; }); - return object; - }, - - toOrderedMap: function() { - // Use Late Binding here to solve the circular dependency. - return OrderedMap(this.toKeyedSeq()); - }, - - toOrderedSet: function() { - // Use Late Binding here to solve the circular dependency. - return OrderedSet(isKeyed(this) ? this.valueSeq() : this); - }, - - toSet: function() { - // Use Late Binding here to solve the circular dependency. - return src_Set__Set(isKeyed(this) ? this.valueSeq() : this); - }, - - toSetSeq: function() { - return new ToSetSequence(this); - }, - - toSeq: function() { - return isIndexed(this) ? this.toIndexedSeq() : - isKeyed(this) ? this.toKeyedSeq() : - this.toSetSeq(); - }, - - toStack: function() { - // Use Late Binding here to solve the circular dependency. - return Stack(isKeyed(this) ? this.valueSeq() : this); - }, - - toList: function() { - // Use Late Binding here to solve the circular dependency. - return List(isKeyed(this) ? this.valueSeq() : this); - }, - - - // ### Common JavaScript methods and properties - - toString: function() { - return '[Iterable]'; - }, - - __toString: function(head, tail) { - if (this.size === 0) { - return head + tail; - } - return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail; - }, - - - // ### ES6 Collection methods (ES6 Array and Map) - - concat: function() {var values = SLICE$0.call(arguments, 0); - return reify(this, concatFactory(this, values)); - }, - - contains: function(searchValue) { - return this.includes(searchValue); - }, - - includes: function(searchValue) { - return this.some(function(value ) {return is(value, searchValue)}); - }, - - entries: function() { - return this.__iterator(ITERATE_ENTRIES); - }, - - every: function(predicate, context) { - assertNotInfinite(this.size); - var returnValue = true; - this.__iterate(function(v, k, c) { - if (!predicate.call(context, v, k, c)) { - returnValue = false; - return false; - } - }); - return returnValue; - }, - - filter: function(predicate, context) { - return reify(this, filterFactory(this, predicate, context, true)); - }, - - find: function(predicate, context, notSetValue) { - var entry = this.findEntry(predicate, context); - return entry ? entry[1] : notSetValue; - }, - - findEntry: function(predicate, context) { - var found; - this.__iterate(function(v, k, c) { - if (predicate.call(context, v, k, c)) { - found = [k, v]; - return false; - } - }); - return found; - }, - - findLastEntry: function(predicate, context) { - return this.toSeq().reverse().findEntry(predicate, context); - }, - - forEach: function(sideEffect, context) { - assertNotInfinite(this.size); - return this.__iterate(context ? sideEffect.bind(context) : sideEffect); - }, - - join: function(separator) { - assertNotInfinite(this.size); - separator = separator !== undefined ? '' + separator : ','; - var joined = ''; - var isFirst = true; - this.__iterate(function(v ) { - isFirst ? (isFirst = false) : (joined += separator); - joined += v !== null && v !== undefined ? v.toString() : ''; - }); - return joined; - }, - - keys: function() { - return this.__iterator(ITERATE_KEYS); - }, - - map: function(mapper, context) { - return reify(this, mapFactory(this, mapper, context)); - }, - - reduce: function(reducer, initialReduction, context) { - assertNotInfinite(this.size); - var reduction; - var useFirst; - if (arguments.length < 2) { - useFirst = true; - } else { - reduction = initialReduction; - } - this.__iterate(function(v, k, c) { - if (useFirst) { - useFirst = false; - reduction = v; - } else { - reduction = reducer.call(context, reduction, v, k, c); - } - }); - return reduction; - }, - - reduceRight: function(reducer, initialReduction, context) { - var reversed = this.toKeyedSeq().reverse(); - return reversed.reduce.apply(reversed, arguments); - }, - - reverse: function() { - return reify(this, reverseFactory(this, true)); - }, - - slice: function(begin, end) { - return reify(this, sliceFactory(this, begin, end, true)); - }, - - some: function(predicate, context) { - return !this.every(not(predicate), context); - }, - - sort: function(comparator) { - return reify(this, sortFactory(this, comparator)); - }, - - values: function() { - return this.__iterator(ITERATE_VALUES); - }, - - - // ### More sequential methods - - butLast: function() { - return this.slice(0, -1); - }, - - isEmpty: function() { - return this.size !== undefined ? this.size === 0 : !this.some(function() {return true}); - }, - - count: function(predicate, context) { - return ensureSize( - predicate ? this.toSeq().filter(predicate, context) : this - ); - }, - - countBy: function(grouper, context) { - return countByFactory(this, grouper, context); - }, - - equals: function(other) { - return deepEqual(this, other); - }, - - entrySeq: function() { - var iterable = this; - if (iterable._cache) { - // We cache as an entries array, so we can just return the cache! - return new ArraySeq(iterable._cache); - } - var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq(); - entriesSequence.fromEntrySeq = function() {return iterable.toSeq()}; - return entriesSequence; - }, - - filterNot: function(predicate, context) { - return this.filter(not(predicate), context); - }, - - findLast: function(predicate, context, notSetValue) { - return this.toKeyedSeq().reverse().find(predicate, context, notSetValue); - }, - - first: function() { - return this.find(returnTrue); - }, - - flatMap: function(mapper, context) { - return reify(this, flatMapFactory(this, mapper, context)); - }, - - flatten: function(depth) { - return reify(this, flattenFactory(this, depth, true)); - }, - - fromEntrySeq: function() { - return new FromEntriesSequence(this); - }, - - get: function(searchKey, notSetValue) { - return this.find(function(_, key) {return is(key, searchKey)}, undefined, notSetValue); - }, - - getIn: function(searchKeyPath, notSetValue) { - var nested = this; - // Note: in an ES6 environment, we would prefer: - // for (var key of searchKeyPath) { - var iter = forceIterator(searchKeyPath); - var step; - while (!(step = iter.next()).done) { - var key = step.value; - nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET; - if (nested === NOT_SET) { - return notSetValue; - } - } - return nested; - }, - - groupBy: function(grouper, context) { - return groupByFactory(this, grouper, context); - }, - - has: function(searchKey) { - return this.get(searchKey, NOT_SET) !== NOT_SET; - }, - - hasIn: function(searchKeyPath) { - return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET; - }, - - isSubset: function(iter) { - iter = typeof iter.includes === 'function' ? iter : Iterable(iter); - return this.every(function(value ) {return iter.includes(value)}); - }, - - isSuperset: function(iter) { - return iter.isSubset(this); - }, - - keySeq: function() { - return this.toSeq().map(keyMapper).toIndexedSeq(); - }, - - last: function() { - return this.toSeq().reverse().first(); - }, - - max: function(comparator) { - return maxFactory(this, comparator); - }, - - maxBy: function(mapper, comparator) { - return maxFactory(this, comparator, mapper); - }, - - min: function(comparator) { - return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator); - }, - - minBy: function(mapper, comparator) { - return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper); - }, - - rest: function() { - return this.slice(1); - }, - - skip: function(amount) { - return this.slice(Math.max(0, amount)); - }, - - skipLast: function(amount) { - return reify(this, this.toSeq().reverse().skip(amount).reverse()); - }, - - skipWhile: function(predicate, context) { - return reify(this, skipWhileFactory(this, predicate, context, true)); - }, - - skipUntil: function(predicate, context) { - return this.skipWhile(not(predicate), context); - }, - - sortBy: function(mapper, comparator) { - return reify(this, sortFactory(this, comparator, mapper)); - }, - - take: function(amount) { - return this.slice(0, Math.max(0, amount)); - }, - - takeLast: function(amount) { - return reify(this, this.toSeq().reverse().take(amount).reverse()); - }, - - takeWhile: function(predicate, context) { - return reify(this, takeWhileFactory(this, predicate, context)); - }, - - takeUntil: function(predicate, context) { - return this.takeWhile(not(predicate), context); - }, - - valueSeq: function() { - return this.toIndexedSeq(); - }, - - - // ### Hashable Object - - hashCode: function() { - return this.__hash || (this.__hash = hashIterable(this)); - }, - - - // ### Internal - - // abstract __iterate(fn, reverse) - - // abstract __iterator(type, reverse) - }); - - // var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; - // var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@'; - // var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@'; - // var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; - - var IterablePrototype = Iterable.prototype; - IterablePrototype[IS_ITERABLE_SENTINEL] = true; - IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values; - IterablePrototype.__toJS = IterablePrototype.toArray; - IterablePrototype.__toStringMapper = quoteString; - IterablePrototype.inspect = - IterablePrototype.toSource = function() { return this.toString(); }; - IterablePrototype.chain = IterablePrototype.flatMap; - - // Temporary warning about using length - (function () { - try { - Object.defineProperty(IterablePrototype, 'length', { - get: function () { - if (!Iterable.noLengthWarning) { - var stack; - try { - throw new Error(); - } catch (error) { - stack = error.stack; - } - if (stack.indexOf('_wrapObject') === -1) { - console && console.warn && console.warn( - 'iterable.length has been deprecated, '+ - 'use iterable.size or iterable.count(). '+ - 'This warning will become a silent error in a future version. ' + - stack - ); - return this.size; - } - } - } - }); - } catch (e) {} - })(); - - - - mixin(KeyedIterable, { - - // ### More sequential methods - - flip: function() { - return reify(this, flipFactory(this)); - }, - - findKey: function(predicate, context) { - var entry = this.findEntry(predicate, context); - return entry && entry[0]; - }, - - findLastKey: function(predicate, context) { - return this.toSeq().reverse().findKey(predicate, context); - }, - - keyOf: function(searchValue) { - return this.findKey(function(value ) {return is(value, searchValue)}); - }, - - lastKeyOf: function(searchValue) { - return this.findLastKey(function(value ) {return is(value, searchValue)}); - }, - - mapEntries: function(mapper, context) {var this$0 = this; - var iterations = 0; - return reify(this, - this.toSeq().map( - function(v, k) {return mapper.call(context, [k, v], iterations++, this$0)} - ).fromEntrySeq() - ); - }, - - mapKeys: function(mapper, context) {var this$0 = this; - return reify(this, - this.toSeq().flip().map( - function(k, v) {return mapper.call(context, k, v, this$0)} - ).flip() - ); - }, - - }); - - var KeyedIterablePrototype = KeyedIterable.prototype; - KeyedIterablePrototype[IS_KEYED_SENTINEL] = true; - KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries; - KeyedIterablePrototype.__toJS = IterablePrototype.toObject; - KeyedIterablePrototype.__toStringMapper = function(v, k) {return JSON.stringify(k) + ': ' + quoteString(v)}; - - - - mixin(IndexedIterable, { - - // ### Conversion to other types - - toKeyedSeq: function() { - return new ToKeyedSequence(this, false); - }, - - - // ### ES6 Collection methods (ES6 Array and Map) - - filter: function(predicate, context) { - return reify(this, filterFactory(this, predicate, context, false)); - }, - - findIndex: function(predicate, context) { - var entry = this.findEntry(predicate, context); - return entry ? entry[0] : -1; - }, - - indexOf: function(searchValue) { - var key = this.toKeyedSeq().keyOf(searchValue); - return key === undefined ? -1 : key; - }, - - lastIndexOf: function(searchValue) { - return this.toSeq().reverse().indexOf(searchValue); - }, - - reverse: function() { - return reify(this, reverseFactory(this, false)); - }, - - slice: function(begin, end) { - return reify(this, sliceFactory(this, begin, end, false)); - }, - - splice: function(index, removeNum /*, ...values*/) { - var numArgs = arguments.length; - removeNum = Math.max(removeNum | 0, 0); - if (numArgs === 0 || (numArgs === 2 && !removeNum)) { - return this; - } - index = resolveBegin(index, this.size); - var spliced = this.slice(0, index); - return reify( - this, - numArgs === 1 ? - spliced : - spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)) - ); - }, - - - // ### More collection methods - - findLastIndex: function(predicate, context) { - var key = this.toKeyedSeq().findLastKey(predicate, context); - return key === undefined ? -1 : key; - }, - - first: function() { - return this.get(0); - }, - - flatten: function(depth) { - return reify(this, flattenFactory(this, depth, false)); - }, - - get: function(index, notSetValue) { - index = wrapIndex(this, index); - return (index < 0 || (this.size === Infinity || - (this.size !== undefined && index > this.size))) ? - notSetValue : - this.find(function(_, key) {return key === index}, undefined, notSetValue); - }, - - has: function(index) { - index = wrapIndex(this, index); - return index >= 0 && (this.size !== undefined ? - this.size === Infinity || index < this.size : - this.indexOf(index) !== -1 - ); - }, - - interpose: function(separator) { - return reify(this, interposeFactory(this, separator)); - }, - - interleave: function(/*...iterables*/) { - var iterables = [this].concat(arrCopy(arguments)); - var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables); - var interleaved = zipped.flatten(true); - if (zipped.size) { - interleaved.size = zipped.size * iterables.length; - } - return reify(this, interleaved); - }, - - last: function() { - return this.get(-1); - }, - - skipWhile: function(predicate, context) { - return reify(this, skipWhileFactory(this, predicate, context, false)); - }, - - zip: function(/*, ...iterables */) { - var iterables = [this].concat(arrCopy(arguments)); - return reify(this, zipWithFactory(this, defaultZipper, iterables)); - }, - - zipWith: function(zipper/*, ...iterables */) { - var iterables = arrCopy(arguments); - iterables[0] = this; - return reify(this, zipWithFactory(this, zipper, iterables)); - }, - - }); - - IndexedIterable.prototype[IS_INDEXED_SENTINEL] = true; - IndexedIterable.prototype[IS_ORDERED_SENTINEL] = true; - - - - mixin(SetIterable, { - - // ### ES6 Collection methods (ES6 Array and Map) - - get: function(value, notSetValue) { - return this.has(value) ? value : notSetValue; - }, - - includes: function(value) { - return this.has(value); - }, - - - // ### More sequential methods - - keySeq: function() { - return this.valueSeq(); - }, - - }); - - SetIterable.prototype.has = IterablePrototype.includes; - - - // Mixin subclasses - - mixin(KeyedSeq, KeyedIterable.prototype); - mixin(IndexedSeq, IndexedIterable.prototype); - mixin(SetSeq, SetIterable.prototype); - - mixin(KeyedCollection, KeyedIterable.prototype); - mixin(IndexedCollection, IndexedIterable.prototype); - mixin(SetCollection, SetIterable.prototype); - - - // #pragma Helper functions - - function keyMapper(v, k) { - return k; - } - - function entryMapper(v, k) { - return [k, v]; - } - - function not(predicate) { - return function() { - return !predicate.apply(this, arguments); - } - } - - function neg(predicate) { - return function() { - return -predicate.apply(this, arguments); - } - } - - function quoteString(value) { - return typeof value === 'string' ? JSON.stringify(value) : value; - } - - function defaultZipper() { - return arrCopy(arguments); - } - - function defaultNegComparator(a, b) { - return a < b ? 1 : a > b ? -1 : 0; - } - - function hashIterable(iterable) { - if (iterable.size === Infinity) { - return 0; - } - var ordered = isOrdered(iterable); - var keyed = isKeyed(iterable); - var h = ordered ? 1 : 0; - var size = iterable.__iterate( - keyed ? - ordered ? - function(v, k) { h = 31 * h + hashMerge(hash(v), hash(k)) | 0; } : - function(v, k) { h = h + hashMerge(hash(v), hash(k)) | 0; } : - ordered ? - function(v ) { h = 31 * h + hash(v) | 0; } : - function(v ) { h = h + hash(v) | 0; } - ); - return murmurHashOfSize(size, h); - } - - function murmurHashOfSize(size, h) { - h = src_Math__imul(h, 0xCC9E2D51); - h = src_Math__imul(h << 15 | h >>> -15, 0x1B873593); - h = src_Math__imul(h << 13 | h >>> -13, 5); - h = (h + 0xE6546B64 | 0) ^ size; - h = src_Math__imul(h ^ h >>> 16, 0x85EBCA6B); - h = src_Math__imul(h ^ h >>> 13, 0xC2B2AE35); - h = smi(h ^ h >>> 16); - return h; - } - - function hashMerge(a, b) { - return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0; // int - } - - var Immutable = { - - Iterable: Iterable, - - Seq: Seq, - Collection: Collection, - Map: src_Map__Map, - OrderedMap: OrderedMap, - List: List, - Stack: Stack, - Set: src_Set__Set, - OrderedSet: OrderedSet, - - Record: Record, - Range: Range, - Repeat: Repeat, - - is: is, - fromJS: fromJS, - - }; - - return Immutable; - -})); \ No newline at end of file diff --git a/dist/immutable.min.js b/dist/immutable.min.js deleted file mode 100644 index 6b92aacbbf..0000000000 --- a/dist/immutable.min.js +++ /dev/null @@ -1,50 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Immutable=e()}(this,function(){"use strict";function t(t,e){e&&(t.prototype=Object.create(e.prototype)),t.prototype.constructor=t}function e(t){return t.value=!1,t}function r(t){t&&(t.value=!0)}function n(){}function i(t,e){e=e||0;for(var r=Math.max(0,t.length-e),n=Array(r),i=0;r>i;i++)n[i]=t[i+e];return n}function o(t){return void 0===t.size&&(t.size=t.__iterate(s)),t.size}function u(t,e){return e>=0?+e:o(t)+ +e}function s(){return!0}function a(t,e,r){return(0===t||void 0!==r&&-r>=t)&&(void 0===e||void 0!==r&&e>=r)}function h(t,e){return c(t,e,0)}function f(t,e){return c(t,e,e)}function c(t,e,r){return void 0===t?r:0>t?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function _(t){return y(t)?t:O(t)}function p(t){return d(t)?t:x(t)}function v(t){return m(t)?t:k(t)}function l(t){return y(t)&&!g(t)?t:A(t)}function y(t){return!(!t||!t[vr])}function d(t){return!(!t||!t[lr])}function m(t){return!(!t||!t[yr])}function g(t){return d(t)||m(t)}function w(t){return!(!t||!t[dr])}function S(t){this.next=t}function z(t,e,r,n){var i=0===t?e:1===t?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function I(){return{value:void 0,done:!0}}function b(t){return!!M(t)}function q(t){return t&&"function"==typeof t.next}function D(t){var e=M(t);return e&&e.call(t)}function M(t){var e=t&&(Sr&&t[Sr]||t[zr]);return"function"==typeof e?e:void 0}function E(t){return t&&"number"==typeof t.length}function O(t){return null===t||void 0===t?T():y(t)?t.toSeq():C(t)}function x(t){return null===t||void 0===t?T().toKeyedSeq():y(t)?d(t)?t.toSeq():t.fromEntrySeq():W(t)}function k(t){return null===t||void 0===t?T():y(t)?d(t)?t.entrySeq():t.toIndexedSeq():B(t)}function A(t){return(null===t||void 0===t?T():y(t)?d(t)?t.entrySeq():t:B(t)).toSetSeq()}function j(t){this._array=t,this.size=t.length}function R(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length}function U(t){this._iterable=t,this.size=t.length||t.size; - -}function K(t){this._iterator=t,this._iteratorCache=[]}function L(t){return!(!t||!t[br])}function T(){return qr||(qr=new j([]))}function W(t){var e=Array.isArray(t)?new j(t).fromEntrySeq():q(t)?new K(t).fromEntrySeq():b(t)?new U(t).fromEntrySeq():"object"==typeof t?new R(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function B(t){var e=J(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function C(t){var e=J(t)||"object"==typeof t&&new R(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function J(t){return E(t)?new j(t):q(t)?new K(t):b(t)?new U(t):void 0}function P(t,e,r,n){var i=t._cache;if(i){for(var o=i.length-1,u=0;o>=u;u++){var s=i[r?o-u:u];if(e(s[1],n?s[0]:u,t)===!1)return u+1}return u}return t.__iterateUncached(e,r)}function H(t,e,r,n){var i=t._cache;if(i){var o=i.length-1,u=0;return new S(function(){var t=i[r?o-u:u];return u++>o?I():z(e,n?t[0]:u-1,t[1])})}return t.__iteratorUncached(e,r)}function N(){throw TypeError("Abstract")}function V(){}function Y(){}function Q(){}function X(t,e){if(t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if(t=t.valueOf(),e=e.valueOf(),t===e||t!==t&&e!==e)return!0;if(!t||!e)return!1}return"function"==typeof t.equals&&"function"==typeof e.equals&&t.equals(e)?!0:!1}function F(t,e){return e?G(e,t,"",{"":t}):Z(t)}function G(t,e,r,n){return Array.isArray(e)?t.call(n,r,k(e).map(function(r,n){return G(t,r,n,e)})):$(e)?t.call(n,r,x(e).map(function(r,n){return G(t,r,n,e)})):e}function Z(t){return Array.isArray(t)?k(t).map(Z).toList():$(t)?x(t).map(Z).toMap():t}function $(t){return t&&(t.constructor===Object||void 0===t.constructor)}function tt(t){return t>>>1&1073741824|3221225471&t}function et(t){if(t===!1||null===t||void 0===t)return 0;if("function"==typeof t.valueOf&&(t=t.valueOf(),t===!1||null===t||void 0===t))return 0;if(t===!0)return 1;var e=typeof t; - -if("number"===e){var r=0|t;for(r!==t&&(r^=4294967295*t);t>4294967295;)t/=4294967295,r^=t;return tt(r)}return"string"===e?t.length>jr?rt(t):nt(t):"function"==typeof t.hashCode?t.hashCode():it(t)}function rt(t){var e=Kr[t];return void 0===e&&(e=nt(t),Ur===Rr&&(Ur=0,Kr={}),Ur++,Kr[t]=e),e}function nt(t){for(var e=0,r=0;t.length>r;r++)e=31*e+t.charCodeAt(r)|0;return tt(e)}function it(t){var e;if(xr&&(e=Dr.get(t),void 0!==e))return e;if(e=t[Ar],void 0!==e)return e;if(!Or){if(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Ar],void 0!==e)return e;if(e=ot(t),void 0!==e)return e}if(e=++kr,1073741824&kr&&(kr=0),xr)Dr.set(t,e);else{if(void 0!==Er&&Er(t)===!1)throw Error("Non-extensible objects are not allowed as keys.");if(Or)Object.defineProperty(t,Ar,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[Ar]=e;else{if(void 0===t.nodeType)throw Error("Unable to set a non-enumerable property on object.");t[Ar]=e}}return e}function ot(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function ut(t,e){if(!t)throw Error(e)}function st(t){ut(t!==1/0,"Cannot perform this action with an infinite size.")}function at(t,e){this._iter=t,this._useKeys=e,this.size=t.size}function ht(t){this._iter=t,this.size=t.size}function ft(t){this._iter=t,this.size=t.size}function ct(t){this._iter=t,this.size=t.size}function _t(t){var e=jt(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=Rt,e.__iterateUncached=function(e,r){var n=this;return t.__iterate(function(t,r){return e(r,t,n)!==!1},r)},e.__iteratorUncached=function(e,r){if(e===wr){ -var n=t.__iterator(e,r);return new S(function(){var t=n.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t})}return t.__iterator(e===gr?mr:gr,r)},e}function pt(t,e,r){var n=jt(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,i){var o=t.get(n,cr);return o===cr?i:e.call(r,o,n,t)},n.__iterateUncached=function(n,i){var o=this;return t.__iterate(function(t,i,u){return n(e.call(r,t,i,u),i,o)!==!1},i)},n.__iteratorUncached=function(n,i){var o=t.__iterator(wr,i);return new S(function(){var i=o.next();if(i.done)return i;var u=i.value,s=u[0];return z(n,s,e.call(r,u[1],s,t),i)})},n}function vt(t,e){var r=jt(t);return r._iter=t,r.size=t.size,r.reverse=function(){return t},t.flip&&(r.flip=function(){var e=_t(t);return e.reverse=function(){return t.flip()},e}),r.get=function(r,n){return t.get(e?r:-1-r,n)},r.has=function(r){return t.has(e?r:-1-r)},r.includes=function(e){return t.includes(e)},r.cacheResult=Rt,r.__iterate=function(e,r){var n=this;return t.__iterate(function(t,r){return e(t,r,n)},!r)},r.__iterator=function(e,r){return t.__iterator(e,!r)},r}function lt(t,e,r,n){var i=jt(t);return n&&(i.has=function(n){var i=t.get(n,cr);return i!==cr&&!!e.call(r,i,n,t)},i.get=function(n,i){var o=t.get(n,cr);return o!==cr&&e.call(r,o,n,t)?o:i}),i.__iterateUncached=function(i,o){var u=this,s=0;return t.__iterate(function(t,o,a){return e.call(r,t,o,a)?(s++,i(t,n?o:s-1,u)):void 0},o),s},i.__iteratorUncached=function(i,o){var u=t.__iterator(wr,o),s=0;return new S(function(){for(;;){var o=u.next();if(o.done)return o;var a=o.value,h=a[0],f=a[1];if(e.call(r,f,h,t))return z(i,n?h:s++,f,o)}})},i}function yt(t,e,r){var n=Lt().asMutable();return t.__iterate(function(i,o){n.update(e.call(r,i,o,t),0,function(t){return t+1})}),n.asImmutable()}function dt(t,e,r){var n=d(t),i=(w(t)?Ie():Lt()).asMutable();t.__iterate(function(o,u){i.update(e.call(r,o,u,t),function(t){return t=t||[],t.push(n?[u,o]:o),t})});var o=At(t);return i.map(function(e){return Ot(t,o(e))})}function mt(t,e,r,n){var i=t.size;if(a(e,r,i))return t; - -var o=h(e,i),s=f(r,i);if(o!==o||s!==s)return mt(t.toSeq().cacheResult(),e,r,n);var c,_=s-o;_===_&&(c=0>_?0:_);var p=jt(t);return p.size=c,!n&&L(t)&&c>=0&&(p.get=function(e,r){return e=u(this,e),e>=0&&c>e?t.get(e+o,r):r}),p.__iterateUncached=function(e,r){var i=this;if(0===c)return 0;if(r)return this.cacheResult().__iterate(e,r);var u=0,s=!0,a=0;return t.__iterate(function(t,r){return s&&(s=u++c)return I();var t=i.next();return n||e===gr?t:e===mr?z(e,s-1,void 0,t):z(e,s-1,t.value[1],t)})},p}function gt(t,e,r){var n=jt(t);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var u=0;return t.__iterate(function(t,i,s){return e.call(r,t,i,s)&&++u&&n(t,i,o)}),u},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var u=t.__iterator(wr,i),s=!0;return new S(function(){if(!s)return I();var t=u.next();if(t.done)return t;var i=t.value,a=i[0],h=i[1];return e.call(r,h,a,o)?n===wr?t:z(n,a,h,t):(s=!1,I())})},n}function wt(t,e,r,n){var i=jt(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,a=0;return t.__iterate(function(t,o,h){return s&&(s=e.call(r,t,o,h))?void 0:(a++,i(t,n?o:a-1,u))}),a},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var s=t.__iterator(wr,o),a=!0,h=0;return new S(function(){var t,o,f;do{if(t=s.next(),t.done)return n||i===gr?t:i===mr?z(i,h++,void 0,t):z(i,h++,t.value[1],t);var c=t.value;o=c[0],f=c[1],a&&(a=e.call(r,f,o,u))}while(a);return i===wr?t:z(i,o,f,t)})},i}function St(t,e){var r=d(t),n=[t].concat(e).map(function(t){return y(t)?r&&(t=p(t)):t=r?W(t):B(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===n.length)return t;if(1===n.length){var i=n[0];if(i===t||r&&d(i)||m(t)&&m(i))return i; - -}var o=new j(n);return r?o=o.toKeyedSeq():m(t)||(o=o.toSetSeq()),o=o.flatten(!0),o.size=n.reduce(function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}},0),o}function zt(t,e,r){var n=jt(t);return n.__iterateUncached=function(n,i){function o(t,a){var h=this;t.__iterate(function(t,i){return(!e||e>a)&&y(t)?o(t,a+1):n(t,r?i:u++,h)===!1&&(s=!0),!s},i)}var u=0,s=!1;return o(t,0),u},n.__iteratorUncached=function(n,i){var o=t.__iterator(n,i),u=[],s=0;return new S(function(){for(;o;){var t=o.next();if(t.done===!1){var a=t.value;if(n===wr&&(a=a[1]),e&&!(e>u.length)||!y(a))return r?t:z(n,s++,a,t);u.push(o),o=a.__iterator(n,i)}else o=u.pop()}return I()})},n}function It(t,e,r){var n=At(t);return t.toSeq().map(function(i,o){return n(e.call(r,i,o,t))}).flatten(!0)}function bt(t,e){var r=jt(t);return r.size=t.size&&2*t.size-1,r.__iterateUncached=function(r,n){var i=this,o=0;return t.__iterate(function(t){return(!o||r(e,o++,i)!==!1)&&r(t,o++,i)!==!1},n),o},r.__iteratorUncached=function(r,n){var i,o=t.__iterator(gr,n),u=0;return new S(function(){return(!i||u%2)&&(i=o.next(),i.done)?i:u%2?z(r,u++,e):z(r,u++,i.value,i)})},r}function qt(t,e,r){e||(e=Ut);var n=d(t),i=0,o=t.toSeq().map(function(e,n){return[n,e,i++,r?r(e,n,t):e]}).toArray();return o.sort(function(t,r){return e(t[3],r[3])||t[2]-r[2]}).forEach(n?function(t,e){o[e].length=2}:function(t,e){o[e]=t[1]}),n?x(o):m(t)?k(o):A(o)}function Dt(t,e,r){if(e||(e=Ut),r){var n=t.toSeq().map(function(e,n){return[e,r(e,n,t)]}).reduce(function(t,r){return Mt(e,t[1],r[1])?r:t});return n&&n[0]}return t.reduce(function(t,r){return Mt(e,t,r)?r:t})}function Mt(t,e,r){var n=t(r,e);return 0===n&&r!==e&&(void 0===r||null===r||r!==r)||n>0}function Et(t,e,r){var n=jt(t);return n.size=new j(r).map(function(t){return t.size}).min(),n.__iterate=function(t,e){for(var r,n=this.__iterator(gr,e),i=0;!(r=n.next()).done&&t(r.value,i++,this)!==!1;);return i},n.__iteratorUncached=function(t,n){var i=r.map(function(t){return t=_(t),D(n?t.reverse():t)}),o=0,u=!1;return new S(function(){var r;return u||(r=i.map(function(t){ -return t.next()}),u=r.some(function(t){return t.done})),u?I():z(t,o++,e.apply(null,r.map(function(t){return t.value})))})},n}function Ot(t,e){return L(t)?e:t.constructor(e)}function xt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function kt(t){return st(t.size),o(t)}function At(t){return d(t)?p:m(t)?v:l}function jt(t){return Object.create((d(t)?x:m(t)?k:A).prototype)}function Rt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):O.prototype.cacheResult.call(this)}function Ut(t,e){return t>e?1:e>t?-1:0}function Kt(t){var e=D(t);if(!e){if(!E(t))throw new TypeError("Expected iterable or array-like: "+t);e=D(_(t))}return e}function Lt(t){return null===t||void 0===t?Qt():Tt(t)?t:Qt().withMutations(function(e){var r=p(t);st(r.size),r.forEach(function(t,r){return e.set(r,t)})})}function Tt(t){return!(!t||!t[Lr])}function Wt(t,e){this.ownerID=t,this.entries=e}function Bt(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r}function Ct(t,e,r){this.ownerID=t,this.count=e,this.nodes=r}function Jt(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r}function Pt(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r}function Ht(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&Vt(t._root)}function Nt(t,e){return z(t,e[0],e[1])}function Vt(t,e){return{node:t,index:0,__prev:e}}function Yt(t,e,r,n){var i=Object.create(Tr);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Qt(){return Wr||(Wr=Yt(0))}function Xt(t,r,n){var i,o;if(t._root){var u=e(_r),s=e(pr);if(i=Ft(t._root,t.__ownerID,0,void 0,r,n,u,s),!s.value)return t;o=t.size+(u.value?n===cr?-1:1:0)}else{if(n===cr)return t;o=1,i=new Wt(t.__ownerID,[[r,n]])}return t.__ownerID?(t.size=o,t._root=i,t.__hash=void 0,t.__altered=!0,t):i?Yt(o,i):Qt()}function Ft(t,e,n,i,o,u,s,a){return t?t.update(e,n,i,o,u,s,a):u===cr?t:(r(a),r(s),new Pt(e,i,[o,u]))}function Gt(t){return t.constructor===Pt||t.constructor===Jt}function Zt(t,e,r,n,i){if(t.keyHash===n)return new Jt(e,n,[t.entry,i]);var o,u=(0===r?t.keyHash:t.keyHash>>>r)&fr,s=(0===r?n:n>>>r)&fr,a=u===s?[Zt(t,e,r+ar,n,i)]:(o=new Pt(e,n,i), -s>u?[t,o]:[o,t]);return new Bt(e,1<u;u++){var s=e[u];o=o.update(t,0,void 0,s[0],s[1])}return o}function te(t,e,r,n){for(var i=0,o=0,u=Array(r),s=0,a=1,h=e.length;h>s;s++,a<<=1){var f=e[s];void 0!==f&&s!==n&&(i|=a,u[o++]=f)}return new Bt(t,i,u)}function ee(t,e,r,n,i){for(var o=0,u=Array(hr),s=0;0!==r;s++,r>>>=1)u[s]=1&r?e[o++]:void 0;return u[n]=i,new Ct(t,o+1,u)}function re(t,e,r){for(var n=[],i=0;r.length>i;i++){var o=r[i],u=p(o);y(o)||(u=u.map(function(t){return F(t)})),n.push(u)}return ie(t,e,n)}function ne(t){return function(e,r,n){return e&&e.mergeDeepWith&&y(r)?e.mergeDeepWith(t,r):t?t(e,r,n):r}}function ie(t,e,r){return r=r.filter(function(t){return 0!==t.size}),0===r.length?t:0!==t.size||t.__ownerID||1!==r.length?t.withMutations(function(t){for(var n=e?function(r,n){t.update(n,cr,function(t){return t===cr?r:e(t,r,n)})}:function(e,r){t.set(r,e)},i=0;r.length>i;i++)r[i].forEach(n)}):t.constructor(r[0])}function oe(t,e,r,n){var i=t===cr,o=e.next();if(o.done){var u=i?r:t,s=n(u);return s===u?t:s}ut(i||t&&t.set,"invalid keyPath");var a=o.value,h=i?cr:t.get(a,cr),f=oe(h,e,r,n);return f===h?t:f===cr?t.remove(a):(i?Qt():t).set(a,f)}function ue(t){return t-=t>>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,t+=t>>16,127&t}function se(t,e,r,n){var o=n?t:i(t);return o[e]=r,o}function ae(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var o=Array(i),u=0,s=0;i>s;s++)s===e?(o[s]=r,u=-1):o[s]=t[s+u];return o}function he(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=Array(n),o=0,u=0;n>u;u++)u===e&&(o=1),i[u]=t[u+o];return i}function fe(t){var e=le();if(null===t||void 0===t)return e;if(ce(t))return t;var r=v(t),n=r.size;return 0===n?e:(st(n),n>0&&hr>n?ve(0,n,ar,null,new _e(r.toArray())):e.withMutations(function(t){t.setSize(n),r.forEach(function(e,r){return t.set(r,e)})}))}function ce(t){return!(!t||!t[Pr])}function _e(t,e){this.array=t,this.ownerID=e}function pe(t,e){function r(t,e,r){ -return 0===e?n(t,r):i(t,e,r)}function n(t,r){var n=r===s?a&&a.array:t&&t.array,i=r>o?0:o-r,h=u-r;return h>hr&&(h=hr),function(){if(i===h)return Vr;var t=e?--h:i++;return n&&n[t]}}function i(t,n,i){var s,a=t&&t.array,h=i>o?0:o-i>>n,f=(u-i>>n)+1;return f>hr&&(f=hr),function(){for(;;){if(s){var t=s();if(t!==Vr)return t;s=null}if(h===f)return Vr;var o=e?--f:h++;s=r(a&&a[o],n-ar,i+(o<=t.size||0>r)return t.withMutations(function(t){0>r?we(t,r).set(0,n):we(t,0,r+1).set(r,n)});r+=t._origin;var i=t._tail,o=t._root,s=e(pr);return r>=ze(t._capacity)?i=de(i,t.__ownerID,0,r,n,s):o=de(o,t.__ownerID,t._level,r,n,s),s.value?t.__ownerID?(t._root=o,t._tail=i,t.__hash=void 0,t.__altered=!0,t):ve(t._origin,t._capacity,t._level,o,i):t}function de(t,e,n,i,o,u){var s=i>>>n&fr,a=t&&t.array.length>s;if(!a&&void 0===o)return t;var h;if(n>0){var f=t&&t.array[s],c=de(f,e,n-ar,i,o,u);return c===f?t:(h=me(t,e),h.array[s]=c,h)}return a&&t.array[s]===o?t:(r(u),h=me(t,e),void 0===o&&s===h.array.length-1?h.array.pop():h.array[s]=o,h)}function me(t,e){return e&&t&&e===t.ownerID?t:new _e(t?t.array.slice():[],e)}function ge(t,e){if(e>=ze(t._capacity))return t._tail;if(1<e){for(var r=t._root,n=t._level;r&&n>0;)r=r.array[e>>>n&fr],n-=ar;return r}}function we(t,e,r){var i=t.__ownerID||new n,o=t._origin,u=t._capacity,s=o+e,a=void 0===r?u:0>r?u+r:o+r;if(s===o&&a===u)return t;if(s>=a)return t.clear();for(var h=t._level,f=t._root,c=0;0>s+c;)f=new _e(f&&f.array.length?[void 0,f]:[],i),h+=ar,c+=1<=1<p?ge(t,a-1):p>_?new _e([],i):v;if(v&&p>_&&u>s&&v.array.length){f=me(f,i);for(var y=f,d=h;d>ar;d-=ar){var m=_>>>d&fr; - -y=y.array[m]=me(y.array[m],i)}y.array[_>>>ar&fr]=v}if(u>a&&(l=l&&l.removeAfter(i,0,a)),s>=p)s-=p,a-=p,h=ar,f=null,l=l&&l.removeBefore(i,0,s);else if(s>o||_>p){for(c=0;f;){var g=s>>>h&fr;if(g!==p>>>h&fr)break;g&&(c+=(1<o&&(f=f.removeBefore(i,h,s-c)),f&&_>p&&(f=f.removeAfter(i,h,p-c)),c&&(s-=c,a-=c)}return t.__ownerID?(t.size=a-s,t._origin=s,t._capacity=a,t._level=h,t._root=f,t._tail=l,t.__hash=void 0,t.__altered=!0,t):ve(s,a,h,f,l)}function Se(t,e,r){for(var n=[],i=0,o=0;r.length>o;o++){var u=r[o],s=v(u);s.size>i&&(i=s.size),y(u)||(s=s.map(function(t){return F(t)})),n.push(s)}return i>t.size&&(t=t.setSize(i)),ie(t,e,n)}function ze(t){return hr>t?0:t-1>>>ar<=hr&&u.size>=2*o.size?(i=u.filter(function(t,e){return void 0!==t&&s!==e}),n=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(r===u.get(s)[1])return t;n=o,i=u.set(s,[e,r])}else n=o.set(e,u.size),i=u.set(u.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t):qe(n,i)}function Ee(t){return null===t||void 0===t?ke():Oe(t)?t:ke().unshiftAll(t)}function Oe(t){return!(!t||!t[Qr])}function xe(t,e,r,n){var i=Object.create(Xr);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function ke(){return Fr||(Fr=xe(0))}function Ae(t){return null===t||void 0===t?Ke():je(t)?t:Ke().withMutations(function(e){var r=l(t);st(r.size),r.forEach(function(t){return e.add(t)})})}function je(t){return!(!t||!t[Gr])}function Re(t,e){ -return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Ue(t,e){var r=Object.create(Zr);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Ke(){return $r||($r=Ue(Qt()))}function Le(t){return null===t||void 0===t?Be():Te(t)?t:Be().withMutations(function(e){var r=l(t);st(r.size),r.forEach(function(t){return e.add(t)})})}function Te(t){return je(t)&&w(t)}function We(t,e){var r=Object.create(tn);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Be(){return en||(en=We(De()))}function Ce(t,e){var r,n=function(o){if(o instanceof n)return o;if(!(this instanceof n))return new n(o);if(!r){r=!0;var u=Object.keys(t);He(i,u),i.size=u.length,i._name=e,i._keys=u,i._defaultValues=t}this._map=Lt(o)},i=n.prototype=Object.create(rn);return i.constructor=n,n}function Je(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._map=e,n.__ownerID=r,n}function Pe(t){return t._name||t.constructor.name||"Record"}function He(t,e){try{e.forEach(Ne.bind(void 0,t))}catch(r){}}function Ne(t,e){Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){ut(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}function Ve(t,e){if(t===e)return!0;if(!y(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||d(t)!==d(e)||m(t)!==m(e)||w(t)!==w(e))return!1;if(0===t.size&&0===e.size)return!0;var r=!g(t);if(w(t)){var n=t.entries();return e.every(function(t,e){var i=n.next().value;return i&&X(i[1],t)&&(r||X(i[0],e))})&&n.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var o=t;t=e,e=o}var u=!0,s=e.__iterate(function(e,n){return(r?t.has(e):i?X(e,t.get(n,cr)):X(t.get(n,cr),e))?void 0:(u=!1,!1)});return u&&t.size===s}function Ye(t,e,r){if(!(this instanceof Ye))return new Ye(t,e,r);if(ut(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),r=void 0===r?1:Math.abs(r),t>e&&(r=-r),this._start=t,this._end=e,this._step=r,this.size=Math.max(0,Math.ceil((e-t)/r-1)+1), -0===this.size){if(nn)return nn;nn=this}}function Qe(t,e){if(!(this instanceof Qe))return new Qe(t,e);if(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),0===this.size){if(on)return on;on=this}}function Xe(t,e){var r=function(r){t.prototype[r]=e[r]};return Object.keys(e).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(r),t}function Fe(t,e){return e}function Ge(t,e){return[e,t]}function Ze(t){return function(){return!t.apply(this,arguments)}}function $e(t){return function(){return-t.apply(this,arguments)}}function tr(t){return"string"==typeof t?JSON.stringify(t):t}function er(){return i(arguments)}function rr(t,e){return e>t?1:t>e?-1:0}function nr(t){if(t.size===1/0)return 0;var e=w(t),r=d(t),n=e?1:0,i=t.__iterate(r?e?function(t,e){n=31*n+or(et(t),et(e))|0}:function(t,e){n=n+or(et(t),et(e))|0}:e?function(t){n=31*n+et(t)|0}:function(t){n=n+et(t)|0});return ir(i,n)}function ir(t,e){return e=Mr(e,3432918353),e=Mr(e<<15|e>>>-15,461845907),e=Mr(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=Mr(e^e>>>16,2246822507),e=Mr(e^e>>>13,3266489909),e=tt(e^e>>>16)}function or(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}var ur=Array.prototype.slice,sr="delete",ar=5,hr=1<=i;i++)if(t(r[e?n-i:i],i,this)===!1)return i+1;return i},j.prototype.__iterator=function(t,e){var r=this._array,n=r.length-1,i=0;return new S(function(){return i>n?I():z(t,i,r[e?n-i++:i++])})},t(R,x),R.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},R.prototype.has=function(t){return this._object.hasOwnProperty(t)},R.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,i=n.length-1,o=0;i>=o;o++){var u=n[e?i-o:o];if(t(r[u],u,this)===!1)return o+1}return o},R.prototype.__iterator=function(t,e){var r=this._object,n=this._keys,i=n.length-1,o=0;return new S(function(){var u=n[e?i-o:o];return o++>i?I():z(t,u,r[u])})},R.prototype[dr]=!0,t(U,k),U.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=this._iterable,n=D(r),i=0;if(q(n))for(var o;!(o=n.next()).done&&t(o.value,i++,this)!==!1;);return i},U.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterable,n=D(r);if(!q(n))return new S(I);var i=0;return new S(function(){var e=n.next();return e.done?e:z(t,i++,e.value)})},t(K,k),K.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var r=this._iterator,n=this._iteratorCache,i=0;n.length>i;)if(t(n[i],i++,this)===!1)return i; - -for(var o;!(o=r.next()).done;){var u=o.value;if(n[i]=u,t(u,i++,this)===!1)break}return i},K.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterator,n=this._iteratorCache,i=0;return new S(function(){if(i>=n.length){var e=r.next();if(e.done)return e;n[i]=e.value}return z(t,i,n[i++])})};var qr;t(N,_),t(V,N),t(Y,N),t(Q,N),N.Keyed=V,N.Indexed=Y,N.Set=Q;var Dr,Mr="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){t=0|t,e=0|e;var r=65535&t,n=65535&e;return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0},Er=Object.isExtensible,Or=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}(),xr="function"==typeof WeakMap;xr&&(Dr=new WeakMap);var kr=0,Ar="__immutablehash__";"function"==typeof Symbol&&(Ar=Symbol(Ar));var jr=16,Rr=255,Ur=0,Kr={};t(at,x),at.prototype.get=function(t,e){return this._iter.get(t,e)},at.prototype.has=function(t){return this._iter.has(t)},at.prototype.valueSeq=function(){return this._iter.valueSeq()},at.prototype.reverse=function(){var t=this,e=vt(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},at.prototype.map=function(t,e){var r=this,n=pt(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},at.prototype.__iterate=function(t,e){var r,n=this;return this._iter.__iterate(this._useKeys?function(e,r){return t(e,r,n)}:(r=e?kt(this):0,function(i){return t(i,e?--r:r++,n)}),e)},at.prototype.__iterator=function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var r=this._iter.__iterator(gr,e),n=e?kt(this):0;return new S(function(){var i=r.next();return i.done?i:z(t,e?--n:n++,i.value,i)})},at.prototype[dr]=!0,t(ht,k),ht.prototype.includes=function(t){return this._iter.includes(t)},ht.prototype.__iterate=function(t,e){var r=this,n=0;return this._iter.__iterate(function(e){return t(e,n++,r)},e)},ht.prototype.__iterator=function(t,e){var r=this._iter.__iterator(gr,e),n=0;return new S(function(){var e=r.next();return e.done?e:z(t,n++,e.value,e); - -})},t(ft,A),ft.prototype.has=function(t){return this._iter.includes(t)},ft.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){return t(e,e,r)},e)},ft.prototype.__iterator=function(t,e){var r=this._iter.__iterator(gr,e);return new S(function(){var e=r.next();return e.done?e:z(t,e.value,e.value,e)})},t(ct,x),ct.prototype.entrySeq=function(){return this._iter.toSeq()},ct.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate(function(e){if(e){xt(e);var n=y(e);return t(n?e.get(1):e[1],n?e.get(0):e[0],r)}},e)},ct.prototype.__iterator=function(t,e){var r=this._iter.__iterator(gr,e);return new S(function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n){xt(n);var i=y(n);return z(t,i?n.get(0):n[0],i?n.get(1):n[1],e)}}})},ht.prototype.cacheResult=at.prototype.cacheResult=ft.prototype.cacheResult=ct.prototype.cacheResult=Rt,t(Lt,V),Lt.prototype.toString=function(){return this.__toString("Map {","}")},Lt.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},Lt.prototype.set=function(t,e){return Xt(this,t,e)},Lt.prototype.setIn=function(t,e){return this.updateIn(t,cr,function(){return e})},Lt.prototype.remove=function(t){return Xt(this,t,cr)},Lt.prototype.deleteIn=function(t){return this.updateIn(t,function(){return cr})},Lt.prototype.update=function(t,e,r){return 1===arguments.length?t(this):this.updateIn([t],e,r)},Lt.prototype.updateIn=function(t,e,r){r||(r=e,e=void 0);var n=oe(this,Kt(t),e,r);return n===cr?void 0:n},Lt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Qt()},Lt.prototype.merge=function(){return re(this,void 0,arguments)},Lt.prototype.mergeWith=function(t){var e=ur.call(arguments,1);return re(this,t,e)},Lt.prototype.mergeIn=function(t){var e=ur.call(arguments,1);return this.updateIn(t,Qt(),function(t){return"function"==typeof t.merge?t.merge.apply(t,e):e[e.length-1]})},Lt.prototype.mergeDeep=function(){return re(this,ne(void 0),arguments); - -},Lt.prototype.mergeDeepWith=function(t){var e=ur.call(arguments,1);return re(this,ne(t),e)},Lt.prototype.mergeDeepIn=function(t){var e=ur.call(arguments,1);return this.updateIn(t,Qt(),function(t){return"function"==typeof t.mergeDeep?t.mergeDeep.apply(t,e):e[e.length-1]})},Lt.prototype.sort=function(t){return Ie(qt(this,t))},Lt.prototype.sortBy=function(t,e){return Ie(qt(this,e,t))},Lt.prototype.withMutations=function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},Lt.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new n)},Lt.prototype.asImmutable=function(){return this.__ensureOwner()},Lt.prototype.wasAltered=function(){return this.__altered},Lt.prototype.__iterator=function(t,e){return new Ht(this,t,e)},Lt.prototype.__iterate=function(t,e){var r=this,n=0;return this._root&&this._root.iterate(function(e){return n++,t(e[1],e[0],r)},e),n},Lt.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Yt(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Lt.isMap=Tt;var Lr="@@__IMMUTABLE_MAP__@@",Tr=Lt.prototype;Tr[Lr]=!0,Tr[sr]=Tr.remove,Tr.removeIn=Tr.deleteIn,Wt.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(X(r,i[o][0]))return i[o][1];return n},Wt.prototype.update=function(t,e,n,o,u,s,a){for(var h=u===cr,f=this.entries,c=0,_=f.length;_>c&&!X(o,f[c][0]);c++);var p=_>c;if(p?f[c][1]===u:h)return this;if(r(a),(h||!p)&&r(s),!h||1!==f.length){if(!p&&!h&&f.length>=Br)return $t(t,f,o,u);var v=t&&t===this.ownerID,l=v?f:i(f);return p?h?c===_-1?l.pop():l[c]=l.pop():l[c]=[o,u]:l.push([o,u]),v?(this.entries=l,this):new Wt(t,l)}},Bt.prototype.get=function(t,e,r,n){void 0===e&&(e=et(r));var i=1<<((0===t?e:e>>>t)&fr),o=this.bitmap;return 0===(o&i)?n:this.nodes[ue(o&i-1)].get(t+ar,e,r,n)},Bt.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=et(n));var s=(0===e?r:r>>>e)&fr,a=1<=Cr)return ee(t,_,h,s,v);if(f&&!v&&2===_.length&&Gt(_[1^c]))return _[1^c];if(f&&v&&1===_.length&&Gt(v))return v;var l=t&&t===this.ownerID,y=f?v?h:h^a:h|a,d=f?v?se(_,c,v,l):he(_,c,l):ae(_,c,v,l);return l?(this.bitmap=y,this.nodes=d,this):new Bt(t,y,d)},Ct.prototype.get=function(t,e,r,n){void 0===e&&(e=et(r));var i=(0===t?e:e>>>t)&fr,o=this.nodes[i];return o?o.get(t+ar,e,r,n):n},Ct.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=et(n));var s=(0===e?r:r>>>e)&fr,a=i===cr,h=this.nodes,f=h[s];if(a&&!f)return this;var c=Ft(f,t,e+ar,r,n,i,o,u);if(c===f)return this;var _=this.count;if(f){if(!c&&(_--,Jr>_))return te(t,h,_,s)}else _++;var p=t&&t===this.ownerID,v=se(h,s,c,p);return p?(this.count=_,this.nodes=v,this):new Ct(t,_,v)},Jt.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;u>o;o++)if(X(r,i[o][0]))return i[o][1];return n},Jt.prototype.update=function(t,e,n,o,u,s,a){void 0===n&&(n=et(o));var h=u===cr;if(n!==this.keyHash)return h?this:(r(a),r(s),Zt(this,t,e,n,[o,u]));for(var f=this.entries,c=0,_=f.length;_>c&&!X(o,f[c][0]);c++);var p=_>c;if(p?f[c][1]===u:h)return this;if(r(a),(h||!p)&&r(s),h&&2===_)return new Pt(t,this.keyHash,f[1^c]);var v=t&&t===this.ownerID,l=v?f:i(f);return p?h?c===_-1?l.pop():l[c]=l.pop():l[c]=[o,u]:l.push([o,u]),v?(this.entries=l,this):new Jt(t,this.keyHash,l)},Pt.prototype.get=function(t,e,r,n){return X(r,this.entry[0])?this.entry[1]:n},Pt.prototype.update=function(t,e,n,i,o,u,s){var a=o===cr,h=X(i,this.entry[0]);return(h?o===this.entry[1]:a)?this:(r(s),a?void r(u):h?t&&t===this.ownerID?(this.entry[1]=o,this):new Pt(t,this.keyHash,[i,o]):(r(u),Zt(this,t,e,et(i),[i,o])))},Wt.prototype.iterate=Jt.prototype.iterate=function(t,e){for(var r=this.entries,n=0,i=r.length-1;i>=n;n++)if(t(r[e?i-n:n])===!1)return!1},Bt.prototype.iterate=Ct.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,i=r.length-1;i>=n;n++){var o=r[e?i-n:n];if(o&&o.iterate(t,e)===!1)return!1}},Pt.prototype.iterate=function(t){return t(this.entry)},t(Ht,S),Ht.prototype.next=function(){ -for(var t=this._type,e=this._stack;e;){var r,n=e.node,i=e.index++;if(n.entry){if(0===i)return Nt(t,n.entry)}else if(n.entries){if(r=n.entries.length-1,r>=i)return Nt(t,n.entries[this._reverse?r-i:i])}else if(r=n.nodes.length-1,r>=i){var o=n.nodes[this._reverse?r-i:i];if(o){if(o.entry)return Nt(t,o.entry);e=this._stack=Vt(o,e)}continue}e=this._stack=this._stack.__prev}return I()};var Wr,Br=hr/4,Cr=hr/2,Jr=hr/4;t(fe,Y),fe.of=function(){return this(arguments)},fe.prototype.toString=function(){return this.__toString("List [","]")},fe.prototype.get=function(t,e){if(t=u(this,t),0>t||t>=this.size)return e;t+=this._origin;var r=ge(this,t);return r&&r.array[t&fr]},fe.prototype.set=function(t,e){return ye(this,t,e)},fe.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},fe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=ar,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):le()},fe.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations(function(r){we(r,0,e+t.length);for(var n=0;t.length>n;n++)r.set(e+n,t[n])})},fe.prototype.pop=function(){return we(this,0,-1)},fe.prototype.unshift=function(){var t=arguments;return this.withMutations(function(e){we(e,-t.length);for(var r=0;t.length>r;r++)e.set(r,t[r])})},fe.prototype.shift=function(){return we(this,1)},fe.prototype.merge=function(){return Se(this,void 0,arguments)},fe.prototype.mergeWith=function(t){var e=ur.call(arguments,1);return Se(this,t,e)},fe.prototype.mergeDeep=function(){return Se(this,ne(void 0),arguments)},fe.prototype.mergeDeepWith=function(t){var e=ur.call(arguments,1);return Se(this,ne(t),e)},fe.prototype.setSize=function(t){return we(this,0,t)},fe.prototype.slice=function(t,e){var r=this.size;return a(t,e,r)?this:we(this,h(t,r),f(e,r))},fe.prototype.__iterator=function(t,e){var r=0,n=pe(this,e);return new S(function(){var e=n();return e===Vr?I():z(t,r++,e)})},fe.prototype.__iterate=function(t,e){ -for(var r,n=0,i=pe(this,e);(r=i())!==Vr&&t(r,n++,this)!==!1;);return n},fe.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?ve(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)},fe.isList=ce;var Pr="@@__IMMUTABLE_LIST__@@",Hr=fe.prototype;Hr[Pr]=!0,Hr[sr]=Hr.remove,Hr.setIn=Tr.setIn,Hr.deleteIn=Hr.removeIn=Tr.removeIn,Hr.update=Tr.update,Hr.updateIn=Tr.updateIn,Hr.mergeIn=Tr.mergeIn,Hr.mergeDeepIn=Tr.mergeDeepIn,Hr.withMutations=Tr.withMutations,Hr.asMutable=Tr.asMutable,Hr.asImmutable=Tr.asImmutable,Hr.wasAltered=Tr.wasAltered,_e.prototype.removeBefore=function(t,e,r){if(r===e?1<>>e&fr;if(n>=this.array.length)return new _e([],t);var i,o=0===n;if(e>0){var u=this.array[n];if(i=u&&u.removeBefore(t,e-ar,r),i===u&&o)return this}if(o&&!i)return this;var s=me(this,t);if(!o)for(var a=0;n>a;a++)s.array[a]=void 0;return i&&(s.array[n]=i),s},_e.prototype.removeAfter=function(t,e,r){if(r===e?1<>>e&fr;if(n>=this.array.length)return this;var i,o=n===this.array.length-1;if(e>0){var u=this.array[n];if(i=u&&u.removeAfter(t,e-ar,r),i===u&&o)return this}if(o&&!i)return this;var s=me(this,t);return o||s.array.pop(),i&&(s.array[n]=i),s};var Nr,Vr={};t(Ie,Lt),Ie.of=function(){return this(arguments)},Ie.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Ie.prototype.get=function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},Ie.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):De()},Ie.prototype.set=function(t,e){return Me(this,t,e)},Ie.prototype.remove=function(t){return Me(this,t,cr)},Ie.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Ie.prototype.__iterate=function(t,e){var r=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],r)},e)},Ie.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e); - -},Ie.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?qe(e,r,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=r,this)},Ie.isOrderedMap=be,Ie.prototype[dr]=!0,Ie.prototype[sr]=Ie.prototype.remove;var Yr;t(Ee,Y),Ee.of=function(){return this(arguments)},Ee.prototype.toString=function(){return this.__toString("Stack [","]")},Ee.prototype.get=function(t,e){var r=this._head;for(t=u(this,t);r&&t--;)r=r.next;return r?r.value:e},Ee.prototype.peek=function(){return this._head&&this._head.value},Ee.prototype.push=function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,r=arguments.length-1;r>=0;r--)e={value:arguments[r],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):xe(t,e)},Ee.prototype.pushAll=function(t){if(t=v(t),0===t.size)return this;st(t.size);var e=this.size,r=this._head;return t.reverse().forEach(function(t){e++,r={value:t,next:r}}),this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):xe(e,r)},Ee.prototype.pop=function(){return this.slice(1)},Ee.prototype.unshift=function(){return this.push.apply(this,arguments)},Ee.prototype.unshiftAll=function(t){return this.pushAll(t)},Ee.prototype.shift=function(){return this.pop.apply(this,arguments)},Ee.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):ke()},Ee.prototype.slice=function(t,e){if(a(t,e,this.size))return this;var r=h(t,this.size),n=f(e,this.size);if(n!==this.size)return Y.prototype.slice.call(this,t,e);for(var i=this.size-r,o=this._head;r--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):xe(i,o)},Ee.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?xe(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},Ee.prototype.__iterate=function(t,e){if(e)return this.reverse().__iterate(t); - -for(var r=0,n=this._head;n&&t(n.value,r++,this)!==!1;)n=n.next;return r},Ee.prototype.__iterator=function(t,e){if(e)return this.reverse().__iterator(t);var r=0,n=this._head;return new S(function(){if(n){var e=n.value;return n=n.next,z(t,r++,e)}return I()})},Ee.isStack=Oe;var Qr="@@__IMMUTABLE_STACK__@@",Xr=Ee.prototype;Xr[Qr]=!0,Xr.withMutations=Tr.withMutations,Xr.asMutable=Tr.asMutable,Xr.asImmutable=Tr.asImmutable,Xr.wasAltered=Tr.wasAltered;var Fr;t(Ae,Q),Ae.of=function(){return this(arguments)},Ae.fromKeys=function(t){return this(p(t).keySeq())},Ae.prototype.toString=function(){return this.__toString("Set {","}")},Ae.prototype.has=function(t){return this._map.has(t)},Ae.prototype.add=function(t){return Re(this,this._map.set(t,!0))},Ae.prototype.remove=function(t){return Re(this,this._map.remove(t))},Ae.prototype.clear=function(){return Re(this,this._map.clear())},Ae.prototype.union=function(){var t=ur.call(arguments,0);return t=t.filter(function(t){return 0!==t.size}),0===t.length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations(function(e){for(var r=0;t.length>r;r++)l(t[r]).forEach(function(t){return e.add(t)})}):this.constructor(t[0])},Ae.prototype.intersect=function(){var t=ur.call(arguments,0);if(0===t.length)return this;t=t.map(function(t){return l(t)});var e=this;return this.withMutations(function(r){e.forEach(function(e){t.every(function(t){return t.includes(e)})||r.remove(e)})})},Ae.prototype.subtract=function(){var t=ur.call(arguments,0);if(0===t.length)return this;t=t.map(function(t){return l(t)});var e=this;return this.withMutations(function(r){e.forEach(function(e){t.some(function(t){return t.includes(e)})&&r.remove(e)})})},Ae.prototype.merge=function(){return this.union.apply(this,arguments)},Ae.prototype.mergeWith=function(){var t=ur.call(arguments,1);return this.union.apply(this,t)},Ae.prototype.sort=function(t){return Le(qt(this,t))},Ae.prototype.sortBy=function(t,e){return Le(qt(this,e,t))},Ae.prototype.wasAltered=function(){return this._map.wasAltered()},Ae.prototype.__iterate=function(t,e){ -var r=this;return this._map.__iterate(function(e,n){return t(n,n,r)},e)},Ae.prototype.__iterator=function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)},Ae.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):(this.__ownerID=t,this._map=e,this)},Ae.isSet=je;var Gr="@@__IMMUTABLE_SET__@@",Zr=Ae.prototype;Zr[Gr]=!0,Zr[sr]=Zr.remove,Zr.mergeDeep=Zr.merge,Zr.mergeDeepWith=Zr.mergeWith,Zr.withMutations=Tr.withMutations,Zr.asMutable=Tr.asMutable,Zr.asImmutable=Tr.asImmutable,Zr.__empty=Ke,Zr.__make=Ue;var $r;t(Le,Ae),Le.of=function(){return this(arguments)},Le.fromKeys=function(t){return this(p(t).keySeq())},Le.prototype.toString=function(){return this.__toString("OrderedSet {","}")},Le.isOrderedSet=Te;var tn=Le.prototype;tn[dr]=!0,tn.__empty=Be,tn.__make=We;var en;t(Ce,V),Ce.prototype.toString=function(){return this.__toString(Pe(this)+" {","}")},Ce.prototype.has=function(t){return this._defaultValues.hasOwnProperty(t)},Ce.prototype.get=function(t,e){if(!this.has(t))return e;var r=this._defaultValues[t];return this._map?this._map.get(t,r):r},Ce.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=this.constructor;return t._empty||(t._empty=Je(this,Qt()))},Ce.prototype.set=function(t,e){if(!this.has(t))throw Error('Cannot set unknown key "'+t+'" on '+Pe(this));var r=this._map&&this._map.set(t,e);return this.__ownerID||r===this._map?this:Je(this,r)},Ce.prototype.remove=function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:Je(this,e)},Ce.prototype.wasAltered=function(){return this._map.wasAltered()},Ce.prototype.__iterator=function(t,e){var r=this;return p(this._defaultValues).map(function(t,e){return r.get(e)}).__iterator(t,e)},Ce.prototype.__iterate=function(t,e){var r=this;return p(this._defaultValues).map(function(t,e){return r.get(e)}).__iterate(t,e)},Ce.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this; - -var e=this._map&&this._map.__ensureOwner(t);return t?Je(this,e,t):(this.__ownerID=t,this._map=e,this)};var rn=Ce.prototype;rn[sr]=rn.remove,rn.deleteIn=rn.removeIn=Tr.removeIn,rn.merge=Tr.merge,rn.mergeWith=Tr.mergeWith,rn.mergeIn=Tr.mergeIn,rn.mergeDeep=Tr.mergeDeep,rn.mergeDeepWith=Tr.mergeDeepWith,rn.mergeDeepIn=Tr.mergeDeepIn,rn.setIn=Tr.setIn,rn.update=Tr.update,rn.updateIn=Tr.updateIn,rn.withMutations=Tr.withMutations,rn.asMutable=Tr.asMutable,rn.asImmutable=Tr.asImmutable,t(Ye,k),Ye.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},Ye.prototype.get=function(t,e){return this.has(t)?this._start+u(this,t)*this._step:e},Ye.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&this.size>e&&e===Math.floor(e)},Ye.prototype.slice=function(t,e){return a(t,e,this.size)?this:(t=h(t,this.size),e=f(e,this.size),t>=e?new Ye(0,0):new Ye(this.get(t,this._end),this.get(e,this._end),this._step))},Ye.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step===0){var r=e/this._step;if(r>=0&&this.size>r)return r}return-1},Ye.prototype.lastIndexOf=function(t){return this.indexOf(t)},Ye.prototype.__iterate=function(t,e){for(var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,o=0;r>=o;o++){if(t(i,o,this)===!1)return o+1;i+=e?-n:n}return o},Ye.prototype.__iterator=function(t,e){var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,o=0;return new S(function(){var u=i;return i+=e?-n:n,o>r?I():z(t,o++,u)})},Ye.prototype.equals=function(t){return t instanceof Ye?this._start===t._start&&this._end===t._end&&this._step===t._step:Ve(this,t)};var nn;t(Qe,k),Qe.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},Qe.prototype.get=function(t,e){return this.has(t)?this._value:e},Qe.prototype.includes=function(t){return X(this._value,t)},Qe.prototype.slice=function(t,e){var r=this.size;return a(t,e,r)?this:new Qe(this._value,f(e,r)-h(t,r))},Qe.prototype.reverse=function(){ -return this},Qe.prototype.indexOf=function(t){return X(this._value,t)?0:-1},Qe.prototype.lastIndexOf=function(t){return X(this._value,t)?this.size:-1},Qe.prototype.__iterate=function(t){for(var e=0;this.size>e;e++)if(t(this._value,e,this)===!1)return e+1;return e},Qe.prototype.__iterator=function(t){var e=this,r=0;return new S(function(){return e.size>r?z(t,r++,e._value):I()})},Qe.prototype.equals=function(t){return t instanceof Qe?X(this._value,t._value):Ve(t)};var on;_.Iterator=S,Xe(_,{toArray:function(){st(this.size);var t=Array(this.size||0);return this.valueSeq().__iterate(function(e,r){t[r]=e}),t},toIndexedSeq:function(){return new ht(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS()},toJSON:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJSON?t.toJSON():t}).__toJS()},toKeyedSeq:function(){return new at(this,!0)},toMap:function(){return Lt(this.toKeyedSeq())},toObject:function(){st(this.size);var t={};return this.__iterate(function(e,r){t[r]=e}),t},toOrderedMap:function(){return Ie(this.toKeyedSeq())},toOrderedSet:function(){return Le(d(this)?this.valueSeq():this)},toSet:function(){return Ae(d(this)?this.valueSeq():this)},toSetSeq:function(){return new ft(this)},toSeq:function(){return m(this)?this.toIndexedSeq():d(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Ee(d(this)?this.valueSeq():this)},toList:function(){return fe(d(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){var t=ur.call(arguments,0);return Ot(this,St(this,t))},contains:function(t){return this.includes(t)},includes:function(t){return this.some(function(e){return X(e,t)})},entries:function(){return this.__iterator(wr)},every:function(t,e){st(this.size);var r=!0;return this.__iterate(function(n,i,o){return t.call(e,n,i,o)?void 0:(r=!1,!1)}),r},filter:function(t,e){return Ot(this,lt(this,t,e,!0)); - -},find:function(t,e,r){var n=this.findEntry(t,e);return n?n[1]:r},findEntry:function(t,e){var r;return this.__iterate(function(n,i,o){return t.call(e,n,i,o)?(r=[i,n],!1):void 0}),r},findLastEntry:function(t,e){return this.toSeq().reverse().findEntry(t,e)},forEach:function(t,e){return st(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){st(this.size),t=void 0!==t?""+t:",";var e="",r=!0;return this.__iterate(function(n){r?r=!1:e+=t,e+=null!==n&&void 0!==n?""+n:""}),e},keys:function(){return this.__iterator(mr)},map:function(t,e){return Ot(this,pt(this,t,e))},reduce:function(t,e,r){st(this.size);var n,i;return arguments.length<2?i=!0:n=e,this.__iterate(function(e,o,u){i?(i=!1,n=e):n=t.call(r,n,e,o,u)}),n},reduceRight:function(){var t=this.toKeyedSeq().reverse();return t.reduce.apply(t,arguments)},reverse:function(){return Ot(this,vt(this,!0))},slice:function(t,e){return Ot(this,mt(this,t,e,!0))},some:function(t,e){return!this.every(Ze(t),e)},sort:function(t){return Ot(this,qt(this,t))},values:function(){return this.__iterator(gr)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(t,e){return o(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return yt(this,t,e)},equals:function(t){return Ve(this,t)},entrySeq:function(){var t=this;if(t._cache)return new j(t._cache);var e=t.toSeq().map(Ge).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(Ze(t),e)},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},first:function(){return this.find(s)},flatMap:function(t,e){return Ot(this,It(this,t,e))},flatten:function(t){return Ot(this,zt(this,t,!0))},fromEntrySeq:function(){return new ct(this)},get:function(t,e){return this.find(function(e,r){return X(r,t)},void 0,e)},getIn:function(t,e){for(var r,n=this,i=Kt(t);!(r=i.next()).done;){var o=r.value;if(n=n&&n.get?n.get(o,cr):cr,n===cr)return e}return n},groupBy:function(t,e){return dt(this,t,e); - -},has:function(t){return this.get(t,cr)!==cr},hasIn:function(t){return this.getIn(t,cr)!==cr},isSubset:function(t){return t="function"==typeof t.includes?t:_(t),this.every(function(e){return t.includes(e)})},isSuperset:function(t){return t.isSubset(this)},keySeq:function(){return this.toSeq().map(Fe).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(t){return Dt(this,t)},maxBy:function(t,e){return Dt(this,e,t)},min:function(t){return Dt(this,t?$e(t):rr)},minBy:function(t,e){return Dt(this,e?$e(e):rr,t)},rest:function(){return this.slice(1)},skip:function(t){return this.slice(Math.max(0,t))},skipLast:function(t){return Ot(this,this.toSeq().reverse().skip(t).reverse())},skipWhile:function(t,e){return Ot(this,wt(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(Ze(t),e)},sortBy:function(t,e){return Ot(this,qt(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return Ot(this,this.toSeq().reverse().take(t).reverse())},takeWhile:function(t,e){return Ot(this,gt(this,t,e))},takeUntil:function(t,e){return this.takeWhile(Ze(t),e)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=nr(this))}});var un=_.prototype;un[vr]=!0,un[Ir]=un.values,un.__toJS=un.toArray,un.__toStringMapper=tr,un.inspect=un.toSource=function(){return""+this},un.chain=un.flatMap,function(){try{Object.defineProperty(un,"length",{get:function(){if(!_.noLengthWarning){var t;try{throw Error()}catch(e){t=e.stack}if(-1===t.indexOf("_wrapObject"))return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+t),this.size}}})}catch(t){}}(),Xe(p,{flip:function(){return Ot(this,_t(this))},findKey:function(t,e){var r=this.findEntry(t,e);return r&&r[0]},findLastKey:function(t,e){return this.toSeq().reverse().findKey(t,e)},keyOf:function(t){return this.findKey(function(e){return X(e,t)})},lastKeyOf:function(t){return this.findLastKey(function(e){ -return X(e,t)})},mapEntries:function(t,e){var r=this,n=0;return Ot(this,this.toSeq().map(function(i,o){return t.call(e,[o,i],n++,r)}).fromEntrySeq())},mapKeys:function(t,e){var r=this;return Ot(this,this.toSeq().flip().map(function(n,i){return t.call(e,n,i,r)}).flip())}});var sn=p.prototype;sn[lr]=!0,sn[Ir]=un.entries,sn.__toJS=un.toObject,sn.__toStringMapper=function(t,e){return JSON.stringify(e)+": "+tr(t)},Xe(v,{toKeyedSeq:function(){return new at(this,!1)},filter:function(t,e){return Ot(this,lt(this,t,e,!1))},findIndex:function(t,e){var r=this.findEntry(t,e);return r?r[0]:-1},indexOf:function(t){var e=this.toKeyedSeq().keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){return this.toSeq().reverse().indexOf(t)},reverse:function(){return Ot(this,vt(this,!1))},slice:function(t,e){return Ot(this,mt(this,t,e,!1))},splice:function(t,e){var r=arguments.length;if(e=Math.max(0|e,0),0===r||2===r&&!e)return this;t=h(t,this.size);var n=this.slice(0,t);return Ot(this,1===r?n:n.concat(i(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.toKeyedSeq().findLastKey(t,e);return void 0===r?-1:r},first:function(){return this.get(0)},flatten:function(t){return Ot(this,zt(this,t,!1))},get:function(t,e){return t=u(this,t),0>t||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find(function(e,r){return r===t},void 0,e)},has:function(t){return t=u(this,t),t>=0&&(void 0!==this.size?this.size===1/0||this.size>t:-1!==this.indexOf(t))},interpose:function(t){return Ot(this,bt(this,t))},interleave:function(){var t=[this].concat(i(arguments)),e=Et(this.toSeq(),k.of,t),r=e.flatten(!0);return e.size&&(r.size=e.size*t.length),Ot(this,r)},last:function(){return this.get(-1)},skipWhile:function(t,e){return Ot(this,wt(this,t,e,!1))},zip:function(){var t=[this].concat(i(arguments));return Ot(this,Et(this,er,t))},zipWith:function(t){var e=i(arguments);return e[0]=this,Ot(this,Et(this,t,e))}}),v.prototype[yr]=!0,v.prototype[dr]=!0,Xe(l,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){ -return this.valueSeq()}}),l.prototype.has=un.includes,Xe(x,p.prototype),Xe(k,v.prototype),Xe(A,l.prototype),Xe(V,p.prototype),Xe(Y,v.prototype),Xe(Q,l.prototype);var an={Iterable:_,Seq:O,Collection:N,Map:Lt,OrderedMap:Ie,List:fe,Stack:Ee,Set:Ae,OrderedSet:Le,Record:Ce,Range:Ye,Repeat:Qe,is:X,fromJS:F};return an}); \ No newline at end of file diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000000..f75f25580e --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,160 @@ +import pluginJs from '@eslint/js'; +import globals from 'globals'; +import pluginJest from 'eslint-plugin-jest'; +import importPlugin from 'eslint-plugin-import'; +import pluginReact from 'eslint-plugin-react'; +// eslint-disable-next-line import/no-unresolved +import tseslint from 'typescript-eslint'; + +/** @type {import('eslint').Linter.Config[]} */ +export default tseslint.config( + { files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'] }, + { + ignores: [ + 'npm/', + 'dist/', + 'type-definitions/flow-tests', + 'website/out/', + 'website/.next/', + ], + }, + { + languageOptions: { + globals: globals.browser, + + // parserOptions: { + // projectService: true, + // tsconfigRootDir: import.meta.dirname, + // }, + }, + }, + pluginJs.configs.recommended, + importPlugin.flatConfigs.recommended, + importPlugin.flatConfigs.typescript, + ...tseslint.configs.recommended, + + { + rules: { + eqeqeq: 'error', + 'constructor-super': 'off', + 'no-constructor-return': 'error', + 'no-else-return': 'error', + 'no-lonely-if': 'error', + 'no-object-constructor': 'error', + 'no-prototype-builtins': 'off', + 'no-this-before-super': 'off', + 'no-useless-concat': 'error', + 'no-var': 'error', + 'operator-assignment': 'error', + 'prefer-arrow-callback': 'error', + 'prefer-spread': 'off', + + '@typescript-eslint/no-unused-vars': [ + 'error', + { + argsIgnorePattern: '^_', + }, + ], + }, + }, + + { + files: ['src/*'], + rules: { + 'no-console': 'error', + }, + }, + + { + files: ['website/'], + ...pluginReact.configs.flat.recommended, + ...pluginReact.configs.flat['jsx-runtime'], + + rules: { + 'react/destructuring-assignment': 'off', + 'react/jsx-boolean-value': 'off', + 'react/jsx-curly-brace-presence': 'off', + 'react/jsx-filename-extension': 'off', + 'react/no-array-index-key': 'off', + 'react/no-danger': 'off', + 'react/no-multi-comp': 'off', + 'react/prefer-es6-class': 'off', + 'react/prefer-stateless-function': 'off', + 'react/prop-types': 'off', + 'react/self-closing-comp': 'error', + 'react/sort-comp': 'off', + 'react/jsx-props-no-spreading': 'off', + + 'react/require-default-props': [ + 'error', + { + functions: 'ignore', + }, + ], + + 'jsx-a11y/no-static-element-interactions': 'off', + }, + }, + + { + files: ['type-definitions/ts-tests/*'], + + rules: { + '@typescript-eslint/no-unused-vars': 'off', + + 'import/no-unresolved': [ + 'error', + { + ignore: ['immutable'], + }, + ], + }, + }, + + { + files: ['__tests__/**/*', 'website/**/*.test.ts', 'perf/*'], + languageOptions: { + globals: pluginJest.environments.globals.globals, + }, + ...pluginJest.configs['flat/recommended'], + ...pluginJest.configs['flat/style'], + plugins: { jest: pluginJest }, + rules: { + ...pluginJest.configs['flat/recommended'].rules, + // TODO activate style rules later + // ...pluginJest.configs['jest/style'].rules, + 'jest/expect-expect': [ + 'error', + { + assertFunctionNames: ['expect', 'expectIs', 'expectIsNot'], + additionalTestBlockFunctions: [], + }, + ], + 'import/no-unresolved': [ + 'error', + { + ignore: ['immutable'], + }, + ], + }, + }, + { + files: ['perf/*'], + rules: { + 'jest/expect-expect': 'off', + 'no-redeclare': 'off', + 'no-var': 'off', + 'prefer-arrow-callback': 'off', + }, + }, + { + files: ['resources/*'], + rules: { + 'no-undef': 'off', + 'no-redeclare': 'off', + 'no-var': 'off', + 'prefer-arrow-callback': 'off', + '@typescript-eslint/no-require-imports': 'off', + }, + } +); diff --git a/jest.config.mjs b/jest.config.mjs new file mode 100644 index 0000000000..4bbd44198b --- /dev/null +++ b/jest.config.mjs @@ -0,0 +1,12 @@ +/** @type {import('jest').Config} */ +const config = { + moduleFileExtensions: ['js', 'ts'], + resolver: '/resources/jestResolver.js', + transform: { + '^.+\\.(js|ts)$': '/resources/jestPreprocessor.js', + }, + testRegex: ['/__tests__/.*\\.(ts|js)$', '/website/.*\\.test\\.(ts|js)$'], + testPathIgnorePatterns: ['/__tests__/ts-utils.ts'], +}; + +export default config; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000..8e728752a6 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,19705 @@ +{ + "name": "immutable", + "version": "5.1.2", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "immutable", + "version": "5.1.2", + "license": "MIT", + "devDependencies": { + "@codemirror/commands": "^6.8.1", + "@codemirror/lang-javascript": "^6.2.3", + "@codemirror/state": "^6.5.2", + "@codemirror/theme-one-dark": "^6.1.2", + "@codemirror/view": "^6.36.5", + "@eslint/js": "^9.20.0", + "@jdeniau/immutable-devtools": "^0.2.0", + "@jest/globals": "^29.7.0", + "@rollup/plugin-buble": "1.0.3", + "@rollup/plugin-commonjs": "28.0.2", + "@rollup/plugin-json": "6.1.0", + "@rollup/plugin-terser": "^0.4.4", + "@rollup/plugin-typescript": "^12.1.2", + "@size-limit/esbuild-why": "^11.2.0", + "@size-limit/preset-small-lib": "^11.2.0", + "@types/prismjs": "^1.26.3", + "@types/random-seed": "0.3.5", + "@types/react": "19.1.0", + "benchmark": "2.1.4", + "codemirror": "^6.0.1", + "colors": "1.4.0", + "cpy-cli": "^5.0.0", + "eslint": "^9.20.1", + "eslint-import-resolver-typescript": "^3.7.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-jest": "^28.11.0", + "eslint-plugin-react": "^7.37.4", + "fast-check": "^4.0.0", + "flow-bin": "0.160.0", + "globals": "^15.15.0", + "jest": "^29.0.0", + "jest-environment-jsdom": "^29.6.4", + "jsonml-html": "^1.2.0", + "make-synchronous": "0.1.1", + "marked": "^11.2.0", + "marked-highlight": "^2.1.0", + "microtime": "3.1.1", + "next": "15.2.4", + "next-sitemap": "4.2.3", + "npm-run-all": "4.1.5", + "prettier": "^3.5.0", + "prismjs": "^1.29.0", + "random-seed": "0.3.0", + "react": "19.1.0", + "react-dom": "19.1.0", + "rimraf": "2.7.1", + "rollup": "4.34.8", + "size-limit": "^11.2.0", + "transducers-js": "0.4.174", + "ts-node": "^10.9.2", + "tslib": "^2.8.1", + "tstyche": "^3.5", + "typescript": "5.7", + "typescript-eslint": "^8.24.0" + }, + "engines": { + "npm": ">=7.0.0" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz", + "integrity": "sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.8.tgz", + "integrity": "sha512-l+lkXCHS6tQEc5oUpK28xBOZ6+HwaH7YwoYQbLFiYb4nS2/l1tKnZEtEWkD0GuiYdvArf9qBS0XlQGXzPMsNqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.8", + "@babel/helper-compilation-targets": "^7.26.5", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.7", + "@babel/parser": "^7.26.8", + "@babel/template": "^7.26.8", + "@babel/traverse": "^7.26.8", + "@babel/types": "^7.26.8", + "@types/gensync": "^1.0.0", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/core/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/core/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/generator": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.8.tgz", + "integrity": "sha512-ef383X5++iZHWAXX0SXQR6ZyQhw/0KtTkrTz61WXRhFM6dhpHulO/RJz79L8S6ugZHJkOOkUrUdxgdF2YiPFnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.26.8", + "@babel/types": "^7.26.8", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz", + "integrity": "sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.26.5", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.10.tgz", + "integrity": "sha512-UPYc3SauzZ3JGgj87GgZ89JVdC5dj0AoetR5Bw6wj4niittNyFh6+eOGonYvJ1ao6B8lEa3Q3klS7ADZ53bc5g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.26.9", + "@babel/types": "^7.26.10" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.10.tgz", + "integrity": "sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.26.10" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", + "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", + "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz", + "integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "@babel/parser": "^7.26.9", + "@babel/types": "^7.26.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.8.tgz", + "integrity": "sha512-nic9tRkjYH0oB2dzr/JoGIm+4Q6SuYeLEiIiZDwBscRMYFJ+tMAz98fuel9ZnbXViA2I0HVSSRRK8DW5fjXStA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.8", + "@babel/parser": "^7.26.8", + "@babel/template": "^7.26.8", + "@babel/types": "^7.26.8", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/traverse/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@babel/types": { + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.10.tgz", + "integrity": "sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "node_modules/@codemirror/autocomplete": { + "version": "6.18.6", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.6.tgz", + "integrity": "sha512-PHHBXFomUs5DF+9tCOM/UoW6XQ4R44lLNNhRaW9PKPTU0D7lIjRg3ElxaJnTwsl/oHiR93WSXDBrekhoUGCPtg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.17.0", + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@codemirror/commands": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.8.1.tgz", + "integrity": "sha512-KlGVYufHMQzxbdQONiLyGQDUW0itrLZwq3CcY7xpv9ZLRHqzkBSoteocBHtMCoY7/Ci4xhzSrToIeLg7FxHuaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.4.0", + "@codemirror/view": "^6.27.0", + "@lezer/common": "^1.1.0" + } + }, + "node_modules/@codemirror/lang-javascript": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.2.3.tgz", + "integrity": "sha512-8PR3vIWg7pSu7ur8A07pGiYHgy3hHj+mRYRCSG8q+mPIrl0F02rgpGv+DsQTHRTc30rydOsf5PZ7yjKFg2Ackw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/language": "^6.6.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.17.0", + "@lezer/common": "^1.0.0", + "@lezer/javascript": "^1.0.0" + } + }, + "node_modules/@codemirror/language": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.11.0.tgz", + "integrity": "sha512-A7+f++LodNNc1wGgoRDTt78cOwWm9KVezApgjOMp1W4hM0898nsqBXwF+sbePE7ZRcjN7Sa1Z5m2oN27XkmEjQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.23.0", + "@lezer/common": "^1.1.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.0.0", + "style-mod": "^4.0.0" + } + }, + "node_modules/@codemirror/lint": { + "version": "6.8.5", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.8.5.tgz", + "integrity": "sha512-s3n3KisH7dx3vsoeGMxsbRAgKe4O1vbrnKBClm99PU0fWxmxsx5rR2PfqQgIt+2MMJBHbiJ5rfIdLYfB9NNvsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.35.0", + "crelt": "^1.0.5" + } + }, + "node_modules/@codemirror/search": { + "version": "6.5.10", + "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.10.tgz", + "integrity": "sha512-RMdPdmsrUf53pb2VwflKGHEe1XVM07hI7vV2ntgw1dmqhimpatSJKva4VA9h4TLUDOD4EIF02201oZurpnEFsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "crelt": "^1.0.5" + } + }, + "node_modules/@codemirror/state": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.5.2.tgz", + "integrity": "sha512-FVqsPqtPWKVVL3dPSxy8wEF/ymIEuVzF1PK3VbUgrxXpJUSHQWWZz4JMToquRxnkw+36LTamCZG2iua2Ptq0fA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@marijn/find-cluster-break": "^1.0.0" + } + }, + "node_modules/@codemirror/theme-one-dark": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/@codemirror/theme-one-dark/-/theme-one-dark-6.1.2.tgz", + "integrity": "sha512-F+sH0X16j/qFLMAfbciKTxVOwkdAS336b7AXTKOZhy8BR3eH/RelsnLgLFINrpST63mmN2OuwUt0W2ndUgYwUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/highlight": "^1.0.0" + } + }, + "node_modules/@codemirror/view": { + "version": "6.36.5", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.36.5.tgz", + "integrity": "sha512-cd+FZEUlu3GQCYnguYm3EkhJ8KJVisqqUsCOKedBoAt/d9c76JUUap6U0UrpElln5k6VyrEOYliMuDAKIeDQLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/state": "^6.5.0", + "style-mod": "^4.1.0", + "w3c-keyname": "^2.2.4" + } + }, + "node_modules/@corex/deepmerge": { + "version": "4.0.43", + "resolved": "https://registry.npmjs.org/@corex/deepmerge/-/deepmerge-4.0.43.tgz", + "integrity": "sha512-N8uEMrMPL0cu/bdboEWpQYb/0i2K5Qn8eCsxzOmxSggJbbQte7ljMRoXm917AbntqTGOzdTu+vP3KOOzoC70HQ==", + "dev": true + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@cspotcode/source-map-support/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.0.tgz", + "integrity": "sha512-64WYIf4UYcdLnbKn/umDlNjQDSS8AgZrI/R9+x5ilkUVFxXcA1Ebl+gQLc/6mERA4407Xof0R7wEyEuj091CVw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.1.tgz", + "integrity": "sha512-kfYGy8IdzTGy+z0vFGvExZtxkFlA4zAxgKEahG9KE1ScBjpQnFsNOX8KTU5ojNru5ed5CVoJYXFtoxaq5nFbjQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.1.tgz", + "integrity": "sha512-dp+MshLYux6j/JjdqVLnMglQlFu+MuVeNrmT5nk6q07wNhCdSnB7QZj+7G8VMUGh1q+vj2Bq8kRsuyA00I/k+Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.1.tgz", + "integrity": "sha512-50tM0zCJW5kGqgG7fQ7IHvQOcAn9TKiVRuQ/lN0xR+T2lzEFvAi1ZcS8DiksFcEpf1t/GYOeOfCAgDHFpkiSmA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.1.tgz", + "integrity": "sha512-GCj6WfUtNldqUzYkN/ITtlhwQqGWu9S45vUXs7EIYf+7rCiiqH9bCloatO9VhxsL0Pji+PF4Lz2XXCES+Q8hDw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.1.tgz", + "integrity": "sha512-5hEZKPf+nQjYoSr/elb62U19/l1mZDdqidGfmFutVUjjUZrOazAtwK+Kr+3y0C/oeJfLlxo9fXb1w7L+P7E4FQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.1.tgz", + "integrity": "sha512-hxVnwL2Dqs3fM1IWq8Iezh0cX7ZGdVhbTfnOy5uURtao5OIVCEyj9xIzemDi7sRvKsuSdtCAhMKarxqtlyVyfA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.1.tgz", + "integrity": "sha512-1MrCZs0fZa2g8E+FUo2ipw6jw5qqQiH+tERoS5fAfKnRx6NXH31tXBKI3VpmLijLH6yriMZsxJtaXUyFt/8Y4A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.1.tgz", + "integrity": "sha512-0IZWLiTyz7nm0xuIs0q1Y3QWJC52R8aSXxe40VUxm6BB1RNmkODtW6LHvWRrGiICulcX7ZvyH6h5fqdLu4gkww==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.1.tgz", + "integrity": "sha512-NdKOhS4u7JhDKw9G3cY6sWqFcnLITn6SqivVArbzIaf3cemShqfLGHYMx8Xlm/lBit3/5d7kXvriTUGa5YViuQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.1.tgz", + "integrity": "sha512-jaN3dHi0/DDPelk0nLcXRm1q7DNJpjXy7yWaWvbfkPvI+7XNSc/lDOnCLN7gzsyzgu6qSAmgSvP9oXAhP973uQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.1.tgz", + "integrity": "sha512-OJykPaF4v8JidKNGz8c/q1lBO44sQNUQtq1KktJXdBLn1hPod5rE/Hko5ugKKZd+D2+o1a9MFGUEIUwO2YfgkQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.1.tgz", + "integrity": "sha512-nGfornQj4dzcq5Vp835oM/o21UMlXzn79KobKlcs3Wz9smwiifknLy4xDCLUU0BWp7b/houtdrgUz7nOGnfIYg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.1.tgz", + "integrity": "sha512-1osBbPEFYwIE5IVB/0g2X6i1qInZa1aIoj1TdL4AaAb55xIIgbg8Doq6a5BzYWgr+tEcDzYH67XVnTmUzL+nXg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.1.tgz", + "integrity": "sha512-/6VBJOwUf3TdTvJZ82qF3tbLuWsscd7/1w+D9LH0W/SqUgM5/JJD0lrJ1fVIfZsqB6RFmLCe0Xz3fmZc3WtyVg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.1.tgz", + "integrity": "sha512-nSut/Mx5gnilhcq2yIMLMe3Wl4FK5wx/o0QuuCLMtmJn+WeWYoEGDN1ipcN72g1WHsnIbxGXd4i/MF0gTcuAjQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.1.tgz", + "integrity": "sha512-cEECeLlJNfT8kZHqLarDBQso9a27o2Zd2AQ8USAEoGtejOrCYHNtKP8XQhMDJMtthdF4GBmjR2au3x1udADQQQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.1.tgz", + "integrity": "sha512-xbfUhu/gnvSEg+EGovRc+kjBAkrvtk38RlerAzQxvMzlB4fXpCFCeUAYzJvrnhFtdeyVCDANSjJvOvGYoeKzFA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.1.tgz", + "integrity": "sha512-O96poM2XGhLtpTh+s4+nP7YCCAfb4tJNRVZHfIE7dgmax+yMP2WgMd2OecBuaATHKTHsLWHQeuaxMRnCsH8+5g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.1.tgz", + "integrity": "sha512-X53z6uXip6KFXBQ+Krbx25XHV/NCbzryM6ehOAeAil7X7oa4XIq+394PWGnwaSQ2WRA0KI6PUO6hTO5zeF5ijA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.1.tgz", + "integrity": "sha512-Na9T3szbXezdzM/Kfs3GcRQNjHzM6GzFBeU1/6IV/npKP5ORtp9zbQjvkDJ47s6BCgaAZnnnu/cY1x342+MvZg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.1.tgz", + "integrity": "sha512-T3H78X2h1tszfRSf+txbt5aOp/e7TAz3ptVKu9Oyir3IAOFPGV6O9c2naym5TOriy1l0nNf6a4X5UXRZSGX/dw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.1.tgz", + "integrity": "sha512-2H3RUvcmULO7dIE5EWJH8eubZAI4xw54H1ilJnRNZdeo8dTADEZ21w6J22XBkXqGJbe0+wnNJtw3UXRoLJnFEg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.1.tgz", + "integrity": "sha512-GE7XvrdOzrb+yVKB9KsRMq+7a2U/K5Cf/8grVFRAGJmfADr/e/ODQ134RK2/eeHqYV5eQRFxb1hY7Nr15fv1NQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.1.tgz", + "integrity": "sha512-uOxSJCIcavSiT6UnBhBzE8wy3n0hOkJsBOzy7HDAuTDE++1DJMRRVCPGisULScHL+a/ZwdXPpXD3IyFKjA7K8A==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.1.tgz", + "integrity": "sha512-Y1EQdcfwMSeQN/ujR5VayLOJ1BHaK+ssyk0AEzPjC+t1lITgsnccPqFjb6V+LsTp/9Iov4ysfjxLaGJ9RPtkVg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz", + "integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.6", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-array/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@eslint/config-array/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@eslint/core": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.11.0.tgz", + "integrity": "sha512-DWUB2pksgNEb6Bz2fggIy1wh6fGgZP4Xyy/Mt0QZPiloKKXerbqq9D3SBQTlCRYOrcRPu4vuz+CGjwdfqxnoWA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", + "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/@eslint/eslintrc/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@eslint/js": { + "version": "9.20.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.20.0.tgz", + "integrity": "sha512-iZA07H9io9Wn836aVTytRaNqh00Sad+EamwOVJT12GTLw1VGMFV/4JaME+JjLtr9fiGaoWgYnS54wrfWsSs4oQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", + "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.5.tgz", + "integrity": "sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.10.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit/node_modules/@eslint/core": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.10.0.tgz", + "integrity": "sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", + "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", + "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", + "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", + "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", + "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", + "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", + "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", + "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", + "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", + "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", + "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", + "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.0.5" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", + "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", + "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", + "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", + "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", + "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", + "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.2.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", + "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", + "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jdeniau/immutable-devtools": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@jdeniau/immutable-devtools/-/immutable-devtools-0.2.0.tgz", + "integrity": "sha512-kncZLhyszWkGz0wAr8eoHFvhczuZz5Ud71OiLIhe5PFQ05nnLgsFdr520Qy+eHhMSL6roJYFrZ73ZJTv48/fUg==", + "dev": true, + "license": "BSD" + }, + "node_modules/@jest/console": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.6.4.tgz", + "integrity": "sha512-wNK6gC0Ha9QeEPSkeJedQuTQqxZYnDPuDcDhVuVatRvMkL4D0VTvFVZj+Yuh6caG2aOfzkUZ36KtCmLNtR02hw==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.6.3", + "jest-util": "^29.6.3", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/core": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.6.4.tgz", + "integrity": "sha512-U/vq5ccNTSVgYH7mHnodHmCffGWHJnz/E1BEWlLuK5pM4FZmGfBn/nrJGLjUsSmyx3otCeqc1T31F4y08AMDLg==", + "dev": true, + "dependencies": { + "@jest/console": "^29.6.4", + "@jest/reporters": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.6.3", + "jest-config": "^29.6.4", + "jest-haste-map": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-resolve-dependencies": "^29.6.4", + "jest-runner": "^29.6.4", + "jest-runtime": "^29.6.4", + "jest-snapshot": "^29.6.4", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "jest-watcher": "^29.6.4", + "micromatch": "^4.0.4", + "pretty-format": "^29.6.3", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/environment": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jest-get-type": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.6.4.tgz", + "integrity": "sha512-sxUjWxm7QdchdrD3NfWKrL8FBsortZeibSJv4XLjESOOjSUOkjQcb0ZHJwfhEGIvBvTluTzfG2yZWZhkrXJu8g==", + "dev": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.6.3", + "jest-util": "^29.6.3", + "jest-worker": "^29.6.4", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/reporters/node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@jest/reporters/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.6.4.tgz", + "integrity": "sha512-uQ1C0AUEN90/dsyEirgMLlouROgSY+Wc/JanVVk0OiUKa5UFh7sJpMEM3aoUBAz2BRNvUJ8j3d294WFuRxSyOQ==", + "dev": true, + "dependencies": { + "@jest/console": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.6.4.tgz", + "integrity": "sha512-E84M6LbpcRq3fT4ckfKs9ryVanwkaIB0Ws9bw3/yP4seRLg/VaCZ/LgW0MCq5wwk4/iP/qnilD41aj2fsw2RMg==", + "dev": true, + "dependencies": { + "@jest/test-result": "^29.6.4", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", + "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@lezer/common": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.3.tgz", + "integrity": "sha512-w7ojc8ejBqr2REPsWxJjrMFsA/ysDCFICn8zEOR9mrqzOu2amhITYuLD8ag6XZf0CFXDrhKqw7+tW8cX66NaDA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@lezer/highlight": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.1.tgz", + "integrity": "sha512-Z5duk4RN/3zuVO7Jq0pGLJ3qynpxUVsh7IbUbGj88+uV2ApSAn6kWg2au3iJb+0Zi7kKtqffIESgNcRXWZWmSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@lezer/javascript": { + "version": "1.4.21", + "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.21.tgz", + "integrity": "sha512-lL+1fcuxWYPURMM/oFZLEDm0XuLN128QPV+VuGtKpeaOGdcl9F2LYC3nh1S9LkPqx9M0mndZFdXCipNAZpzIkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@lezer/common": "^1.2.0", + "@lezer/highlight": "^1.1.3", + "@lezer/lr": "^1.3.0" + } + }, + "node_modules/@lezer/lr": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.2.tgz", + "integrity": "sha512-pu0K1jCIdnQ12aWNaAVU5bzi7Bd1w54J3ECgANPmYLtQKP0HBj2cE/5coBD66MT10xbtIuUr7tg0Shbsvk0mDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@marijn/find-cluster-break": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@marijn/find-cluster-break/-/find-cluster-break-1.0.2.tgz", + "integrity": "sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@next/env": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/env/-/env-15.2.4.tgz", + "integrity": "sha512-+SFtMgoiYP3WoSswuNmxJOCwi06TdWE733D+WPjpXIe4LXGULwEaofiiAy6kbS0+XjM5xF5n3lKuBwN2SnqD9g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@next/swc-darwin-arm64": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.2.4.tgz", + "integrity": "sha512-1AnMfs655ipJEDC/FHkSr0r3lXBgpqKo4K1kiwfUf3iE68rDFXZ1TtHdMvf7D0hMItgDZ7Vuq3JgNMbt/+3bYw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-darwin-x64": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.2.4.tgz", + "integrity": "sha512-3qK2zb5EwCwxnO2HeO+TRqCubeI/NgCe+kL5dTJlPldV/uwCnUgC7VbEzgmxbfrkbjehL4H9BPztWOEtsoMwew==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.2.4.tgz", + "integrity": "sha512-HFN6GKUcrTWvem8AZN7tT95zPb0GUGv9v0d0iyuTb303vbXkkbHDp/DxufB04jNVD+IN9yHy7y/6Mqq0h0YVaQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.2.4.tgz", + "integrity": "sha512-Oioa0SORWLwi35/kVB8aCk5Uq+5/ZIumMK1kJV+jSdazFm2NzPDztsefzdmzzpx5oGCJ6FkUC7vkaUseNTStNA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.2.4.tgz", + "integrity": "sha512-yb5WTRaHdkgOqFOZiu6rHV1fAEK0flVpaIN2HB6kxHVSy/dIajWbThS7qON3W9/SNOH2JWkVCyulgGYekMePuw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.2.4.tgz", + "integrity": "sha512-Dcdv/ix6srhkM25fgXiyOieFUkz+fOYkHlydWCtB0xMST6X9XYI3yPDKBZt1xuhOytONsIFJFB08xXYsxUwJLw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.2.4.tgz", + "integrity": "sha512-dW0i7eukvDxtIhCYkMrZNQfNicPDExt2jPb9AZPpL7cfyUo7QSNl1DjsHjmmKp6qNAqUESyT8YFl/Aw91cNJJg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.2.4.tgz", + "integrity": "sha512-SbnWkJmkS7Xl3kre8SdMF6F/XDh1DTFEhp0jRTj/uB8iPKoU2bb2NDfcu+iifv1+mxQEd1g2vvSxcZbXSKyWiQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nolyfill/is-core-module": { + "version": "1.0.39", + "resolved": "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz", + "integrity": "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.4.0" + } + }, + "node_modules/@rollup/plugin-buble": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-buble/-/plugin-buble-1.0.3.tgz", + "integrity": "sha512-QYD9BKkJoof0FdCFeSYYhF6/Y8e0Mnf+098xGgmWOFJ4UPHlWujjqOYeVwEm2hJPOmlR5k7HPUdAjqtOWhN64Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "@types/buble": "^0.19.2", + "buble": "^0.20.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-buble/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@rollup/plugin-buble/node_modules/buble": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/buble/-/buble-0.20.0.tgz", + "integrity": "sha512-/1gnaMQE8xvd5qsNBl+iTuyjJ9XxeaVxAMF86dQ4EyxFJOZtsgOS8Ra+7WHgZTam5IFDtt4BguN0sH0tVTKrOw==", + "dev": true, + "dependencies": { + "acorn": "^6.4.1", + "acorn-dynamic-import": "^4.0.0", + "acorn-jsx": "^5.2.0", + "chalk": "^2.4.2", + "magic-string": "^0.25.7", + "minimist": "^1.2.5", + "regexpu-core": "4.5.4" + }, + "bin": { + "buble": "bin/buble" + } + }, + "node_modules/@rollup/plugin-buble/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@rollup/plugin-buble/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@rollup/plugin-buble/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@rollup/plugin-buble/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@rollup/plugin-buble/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@rollup/plugin-buble/node_modules/regexpu-core": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", + "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", + "dev": true, + "dependencies": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.0.2", + "regjsgen": "^0.5.0", + "regjsparser": "^0.6.0", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@rollup/plugin-buble/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@rollup/plugin-commonjs": { + "version": "28.0.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.2.tgz", + "integrity": "sha512-BEFI2EDqzl+vA1rl97IDRZ61AIwGH093d9nz8+dThxJNH8oSoB7MjWvPCX3dkaK1/RCJ/1v/R1XB15FuSs0fQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.0.1", + "commondir": "^1.0.1", + "estree-walker": "^2.0.2", + "fdir": "^6.2.0", + "is-reference": "1.2.1", + "magic-string": "^0.30.3", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=16.0.0 || 14 >= 14.17" + }, + "peerDependencies": { + "rollup": "^2.68.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/fdir": { + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", + "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/magic-string": { + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/@rollup/plugin-commonjs/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/@rollup/plugin-json": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.1.0.tgz", + "integrity": "sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.1.0" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-terser": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz", + "integrity": "sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "serialize-javascript": "^6.0.1", + "smob": "^1.0.0", + "terser": "^5.17.4" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/plugin-typescript": { + "version": "12.1.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.1.2.tgz", + "integrity": "sha512-cdtSp154H5sv637uMr1a8OTWB0L1SWDSm1rDGiyfcGcvQ6cuTs4MDk2BVEBGysUWago4OJN4EQZqOTl/QY3Jgg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rollup/pluginutils": "^5.1.0", + "resolve": "^1.22.1" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^2.14.0||^3.0.0||^4.0.0", + "tslib": "*", + "typescript": ">=3.7.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + }, + "tslib": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.4.tgz", + "integrity": "sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.8.tgz", + "integrity": "sha512-q217OSE8DTp8AFHuNHXo0Y86e1wtlfVrXiAlwkIvGRQv9zbc6mE3sjIVfwI8sYUyNxwOg0j/Vm1RKM04JcWLJw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.34.8.tgz", + "integrity": "sha512-Gigjz7mNWaOL9wCggvoK3jEIUUbGul656opstjaUSGC3eT0BM7PofdAJaBfPFWWkXNVAXbaQtC99OCg4sJv70Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.34.8.tgz", + "integrity": "sha512-02rVdZ5tgdUNRxIUrFdcMBZQoaPMrxtwSb+/hOfBdqkatYHR3lZ2A2EGyHq2sGOd0Owk80oV3snlDASC24He3Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.34.8.tgz", + "integrity": "sha512-qIP/elwR/tq/dYRx3lgwK31jkZvMiD6qUtOycLhTzCvrjbZ3LjQnEM9rNhSGpbLXVJYQ3rq39A6Re0h9tU2ynw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.34.8.tgz", + "integrity": "sha512-IQNVXL9iY6NniYbTaOKdrlVP3XIqazBgJOVkddzJlqnCpRi/yAeSOa8PLcECFSQochzqApIOE1GHNu3pCz+BDA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.34.8.tgz", + "integrity": "sha512-TYXcHghgnCqYFiE3FT5QwXtOZqDj5GmaFNTNt3jNC+vh22dc/ukG2cG+pi75QO4kACohZzidsq7yKTKwq/Jq7Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.34.8.tgz", + "integrity": "sha512-A4iphFGNkWRd+5m3VIGuqHnG3MVnqKe7Al57u9mwgbyZ2/xF9Jio72MaY7xxh+Y87VAHmGQr73qoKL9HPbXj1g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.34.8.tgz", + "integrity": "sha512-S0lqKLfTm5u+QTxlFiAnb2J/2dgQqRy/XvziPtDd1rKZFXHTyYLoVL58M/XFwDI01AQCDIevGLbQrMAtdyanpA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.34.8.tgz", + "integrity": "sha512-jpz9YOuPiSkL4G4pqKrus0pn9aYwpImGkosRKwNi+sJSkz+WU3anZe6hi73StLOQdfXYXC7hUfsQlTnjMd3s1A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.34.8.tgz", + "integrity": "sha512-KdSfaROOUJXgTVxJNAZ3KwkRc5nggDk+06P6lgi1HLv1hskgvxHUKZ4xtwHkVYJ1Rep4GNo+uEfycCRRxht7+Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.34.8.tgz", + "integrity": "sha512-NyF4gcxwkMFRjgXBM6g2lkT58OWztZvw5KkV2K0qqSnUEqCVcqdh2jN4gQrTn/YUpAcNKyFHfoOZEer9nwo6uQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.34.8.tgz", + "integrity": "sha512-LMJc999GkhGvktHU85zNTDImZVUCJ1z/MbAJTnviiWmmjyckP5aQsHtcujMjpNdMZPT2rQEDBlJfubhs3jsMfw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.34.8.tgz", + "integrity": "sha512-xAQCAHPj8nJq1PI3z8CIZzXuXCstquz7cIOL73HHdXiRcKk8Ywwqtx2wrIy23EcTn4aZ2fLJNBB8d0tQENPCmw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.34.8.tgz", + "integrity": "sha512-DdePVk1NDEuc3fOe3dPPTb+rjMtuFw89gw6gVWxQFAuEqqSdDKnrwzZHrUYdac7A7dXl9Q2Vflxpme15gUWQFA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.34.8.tgz", + "integrity": "sha512-8y7ED8gjxITUltTUEJLQdgpbPh1sUQ0kMTmufRF/Ns5tI9TNMNlhWtmPKKHCU0SilX+3MJkZ0zERYYGIVBYHIA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.34.8.tgz", + "integrity": "sha512-SCXcP0ZpGFIe7Ge+McxY5zKxiEI5ra+GT3QRxL0pMMtxPfpyLAKleZODi1zdRHkz5/BhueUrYtYVgubqe9JBNQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.34.8.tgz", + "integrity": "sha512-YHYsgzZgFJzTRbth4h7Or0m5O74Yda+hLin0irAIobkLQFRQd1qWmnoVfwmKm9TXIZVAD0nZ+GEb2ICicLyCnQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.34.8.tgz", + "integrity": "sha512-r3NRQrXkHr4uWy5TOjTpTYojR9XmF0j/RYgKCef+Ag46FWUTltm5ziticv8LdNsDMehjJ543x/+TJAek/xBA2w==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.34.8.tgz", + "integrity": "sha512-U0FaE5O1BCpZSeE6gBl3c5ObhePQSfk9vDRToMmTkbhCOgW4jqvtS5LGyQ76L1fH8sM0keRp4uDTsbjiUyjk0g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rtsao/scc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/@size-limit/esbuild-why": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@size-limit/esbuild-why/-/esbuild-why-11.2.0.tgz", + "integrity": "sha512-VtoQbbkvFbF314LWEaEp1+IjG0DH+9w6nP//D6Gd48SEAPLoBgqk287mjYTF9WYxg9N5lo8KjpXxEFk4gOXNpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild-visualizer": "^0.7.0", + "open": "^10.1.0" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "size-limit": "11.2.0" + } + }, + "node_modules/@size-limit/preset-small-lib": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@size-limit/preset-small-lib/-/preset-small-lib-11.2.0.tgz", + "integrity": "sha512-RFbbIVfv8/QDgTPyXzjo5NKO6CYyK5Uq5xtNLHLbw5RgSKrgo8WpiB/fNivZuNd/5Wk0s91PtaJ9ThNcnFuI3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@size-limit/esbuild": "11.2.0", + "@size-limit/file": "11.2.0", + "size-limit": "11.2.0" + }, + "peerDependencies": { + "size-limit": "11.2.0" + } + }, + "node_modules/@size-limit/preset-small-lib/node_modules/@size-limit/esbuild": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@size-limit/esbuild/-/esbuild-11.2.0.tgz", + "integrity": "sha512-vSg9H0WxGQPRzDnBzeDyD9XT0Zdq0L+AI3+77/JhxznbSCMJMMr8ndaWVQRhOsixl97N0oD4pRFw2+R1Lcvi6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.25.0", + "nanoid": "^5.1.0" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "size-limit": "11.2.0" + } + }, + "node_modules/@size-limit/preset-small-lib/node_modules/@size-limit/file": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@size-limit/file/-/file-11.2.0.tgz", + "integrity": "sha512-OZHE3putEkQ/fgzz3Tp/0hSmfVo3wyTpOJSRNm6AmcwX4Nm9YtTfbQQ/hZRwbBFR23S7x2Sd9EbqYzngKwbRoA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "size-limit": "11.2.0" + } + }, + "node_modules/@size-limit/preset-small-lib/node_modules/nanoid": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.4.tgz", + "integrity": "sha512-GTFcMIDgR7tqji/LpSY8rtg464VnJl/j6ypoehYnuGb+Y8qZUdtKB8WVCXon0UEZgFDbuUxpIl//6FHLHgXSNA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.js" + }, + "engines": { + "node": "^18 || >=20" + } + }, + "node_modules/@swc/counter": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", + "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/@swc/helpers": { + "version": "0.5.15", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", + "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.8.0" + } + }, + "node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/babel__core": { + "version": "7.20.1", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.1.tgz", + "integrity": "sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", + "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", + "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.20.1", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.1.tgz", + "integrity": "sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.20.7" + } + }, + "node_modules/@types/buble": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@types/buble/-/buble-0.19.2.tgz", + "integrity": "sha512-uUD8zIfXMKThmFkahTXDGI3CthFH1kMg2dOm3KLi4GlC5cbARA64bEcUMbbWdWdE73eoc/iBB9PiTMqH0dNS2Q==", + "dev": true, + "dependencies": { + "magic-string": "^0.25.0" + } + }, + "node_modules/@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/gensync": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/gensync/-/gensync-1.0.4.tgz", + "integrity": "sha512-C3YYeRQWp2fmq9OryX+FoDy8nXS6scQ7dPptD8LnFDAUNcKWJjXQKDNJD3HVm+kOUsXhTOkpi69vI4EuAr95bA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/graceful-fs": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz", + "integrity": "sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/jsdom": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.1.tgz", + "integrity": "sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "14.17.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.3.tgz", + "integrity": "sha512-e6ZowgGJmTuXa3GyaPbTGxX17tnThl2aSSizrFthQ7m9uLGZBXiGhgE55cjRZTF5kjZvYn9EOPOMljdjwbflxw==", + "dev": true + }, + "node_modules/@types/prismjs": { + "version": "1.26.3", + "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.3.tgz", + "integrity": "sha512-A0D0aTXvjlqJ5ZILMz3rNfDBOx9hHxLZYv2by47Sm/pqW35zzjusrZTryatjN/Rf8Us2gZrJD+KeHbUSTux1Cw==", + "dev": true + }, + "node_modules/@types/random-seed": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@types/random-seed/-/random-seed-0.3.5.tgz", + "integrity": "sha512-CftxcDPAHgs0SLHU2dt+ZlDPJfGqLW3sZlC/ATr5vJDSe5tRLeOne7HMvCOJnFyF8e1U41wqzs3h6AMC613xtA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.0.tgz", + "integrity": "sha512-UaicktuQI+9UKyA4njtDOGBD/67t8YEBt2xdfqu8+gP9hqPUPsiXlNPcpS2gVdjmis5GKPG3fCxbQLVgxsQZ8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.0.2" + } + }, + "node_modules/@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "node_modules/@types/tough-cookie": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.2.tgz", + "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==", + "dev": true + }, + "node_modules/@types/yargs": { + "version": "17.0.24", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", + "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.24.0.tgz", + "integrity": "sha512-aFcXEJJCI4gUdXgoo/j9udUYIHgF23MFkg09LFz2dzEmU0+1Plk4rQWv/IYKvPHAtlkkGoB3m5e6oUp+JPsNaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.24.0", + "@typescript-eslint/type-utils": "8.24.0", + "@typescript-eslint/utils": "8.24.0", + "@typescript-eslint/visitor-keys": "8.24.0", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.24.0.tgz", + "integrity": "sha512-MFDaO9CYiard9j9VepMNa9MTcqVvSny2N4hkY6roquzj8pdCBRENhErrteaQuu7Yjn1ppk0v1/ZF9CG3KIlrTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.24.0", + "@typescript-eslint/types": "8.24.0", + "@typescript-eslint/typescript-estree": "8.24.0", + "@typescript-eslint/visitor-keys": "8.24.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.24.0.tgz", + "integrity": "sha512-HZIX0UByphEtdVBKaQBgTDdn9z16l4aTUz8e8zPQnyxwHBtf5vtl1L+OhH+m1FGV9DrRmoDuYKqzVrvWDcDozw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.24.0", + "@typescript-eslint/visitor-keys": "8.24.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.24.0.tgz", + "integrity": "sha512-8fitJudrnY8aq0F1wMiPM1UUgiXQRJ5i8tFjq9kGfRajU+dbPyOuHbl0qRopLEidy0MwqgTHDt6CnSeXanNIwA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "8.24.0", + "@typescript-eslint/utils": "8.24.0", + "debug": "^4.3.4", + "ts-api-utils": "^2.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/types": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.24.0.tgz", + "integrity": "sha512-VacJCBTyje7HGAw7xp11q439A+zeGG0p0/p2zsZwpnMzjPB5WteaWqt4g2iysgGFafrqvyLWqq6ZPZAOCoefCw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.24.0.tgz", + "integrity": "sha512-ITjYcP0+8kbsvT9bysygfIfb+hBj6koDsu37JZG7xrCiy3fPJyNmfVtaGsgTUSEuTzcvME5YI5uyL5LD1EV5ZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.24.0", + "@typescript-eslint/visitor-keys": "8.24.0", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.24.0.tgz", + "integrity": "sha512-07rLuUBElvvEb1ICnafYWr4hk8/U7X9RDCOqd9JcAMtjh/9oRmcfN4yGzbPVirgMR0+HLVHehmu19CWeh7fsmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.24.0", + "@typescript-eslint/types": "8.24.0", + "@typescript-eslint/typescript-estree": "8.24.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.24.0.tgz", + "integrity": "sha512-kArLq83QxGLbuHrTMoOEWO+l2MwsNS2TGISEdx8xgqpkbytB07XmlQyQdNDrCc1ecSqx0cnmhGvpX+VBwqqSkg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.24.0", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/abab": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", + "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", + "dev": true + }, + "node_modules/acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-dynamic-import": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", + "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0" + } + }, + "node_modules/acorn-globals": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz", + "integrity": "sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==", + "dev": true, + "dependencies": { + "acorn": "^8.1.0", + "acorn-walk": "^8.0.2" + } + }, + "node_modules/acorn-globals/node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agent-base/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/aggregate-error": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", + "dev": true, + "license": "MIT", + "dependencies": { + "clean-stack": "^4.0.0", + "indent-string": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "license": "MIT" + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/array-buffer-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-includes": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlast": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", + "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.findlastindex": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", + "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", + "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.tosorted": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz", + "integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3", + "es-errors": "^1.3.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/arraybuffer.prototype.slice": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/arrify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-3.0.0.tgz", + "integrity": "sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/async-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "node_modules/available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "possible-typed-array-names": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/babel-jest": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.6.4.tgz", + "integrity": "sha512-meLj23UlSLddj6PC+YTOFRgDAtjnZom8w/ACsrx0gtPtv5cJZk0A5Unk5bV4wixD7XaPCN1fQvpww8czkZURmw==", + "dev": true, + "dependencies": { + "@jest/transform": "^29.6.4", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "dev": true, + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "dev": true, + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/benchmark": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", + "integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=", + "dev": true, + "dependencies": { + "lodash": "^4.17.4", + "platform": "^1.3.3" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/bundle-name": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz", + "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "run-applescript": "^7.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dev": true, + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "node_modules/bytes-iec": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/bytes-iec/-/bytes-iec-3.1.1.tgz", + "integrity": "sha512-fey6+4jDK7TFtFg/klGSvNKJctyU7n2aQdnM+CO0ruLPbqqMOM8Tio0Pc+deqUeVKX1tL5DQep1zQ7+37aTAsA==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001699", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001699.tgz", + "integrity": "sha512-b+uH5BakXZ9Do9iK+CkDmctUSEqZl+SP056vc5usa0PL+ev5OHw003rZXcnjNDv3L8P5j6rwT6C0BPKSikW08w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ci-info": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", + "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", + "dev": true + }, + "node_modules/clean-stack": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/clean-stack/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/codemirror": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.1.tgz", + "integrity": "sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/commands": "^6.0.0", + "@codemirror/language": "^6.0.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/search": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", + "dev": true + }, + "node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, + "node_modules/cp-file": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-10.0.0.tgz", + "integrity": "sha512-vy2Vi1r2epK5WqxOLnskeKeZkdZvTKfFZQCplE3XWsP+SUJyd5XAUFC9lFgTjjXJF2GMne/UML14iEmkAaDfFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.10", + "nested-error-stacks": "^2.1.1", + "p-event": "^5.0.1" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cpy": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/cpy/-/cpy-10.1.0.tgz", + "integrity": "sha512-VC2Gs20JcTyeQob6UViBLnyP0bYHkBh6EiKzot9vi2DmeGlFT9Wd7VG3NBrkNx/jYvFBeyDOMMHdHQhbtKLgHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "arrify": "^3.0.0", + "cp-file": "^10.0.0", + "globby": "^13.1.4", + "junk": "^4.0.1", + "micromatch": "^4.0.5", + "nested-error-stacks": "^2.1.1", + "p-filter": "^3.0.0", + "p-map": "^6.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cpy-cli": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cpy-cli/-/cpy-cli-5.0.0.tgz", + "integrity": "sha512-fb+DZYbL9KHc0BC4NYqGRrDIJZPXUmjjtqdw4XRRg8iV8dIfghUX/WiL+q4/B/KFTy3sK6jsbUhBaz0/Hxg7IQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "cpy": "^10.1.0", + "meow": "^12.0.1" + }, + "bin": { + "cpy": "cli.js" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cpy/node_modules/globby": { + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", + "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.3.0", + "ignore": "^5.2.4", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cpy/node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/crelt": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", + "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/cssom": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", + "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==", + "dev": true + }, + "node_modules/cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "dev": true, + "dependencies": { + "cssom": "~0.3.6" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cssstyle/node_modules/cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "dev": true + }, + "node_modules/csstype": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.8.tgz", + "integrity": "sha512-jXKhWqXPmlUeoQnF/EhTtTl4C9SnrxSH/jZUih3jmO6lBKr99rP3/+FmrMj4EFpOXzMtXHAZkd3x0E6h6Fgflw==", + "dev": true + }, + "node_modules/data-urls": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", + "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", + "dev": true, + "dependencies": { + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/data-view-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/data-view-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/inspect-js" + } + }, + "node_modules/data-view-byte-offset": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/decimal.js": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "dev": true + }, + "node_modules/dedent": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "dev": true, + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/default-browser": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.2.1.tgz", + "integrity": "sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==", + "dev": true, + "license": "MIT", + "dependencies": { + "bundle-name": "^4.1.0", + "default-browser-id": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser-id": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.0.tgz", + "integrity": "sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-lazy-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "dev": true, + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/domexception": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", + "dev": true, + "dependencies": { + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.97", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.97.tgz", + "integrity": "sha512-HKLtaH02augM7ZOdYRuO19rWDeY+QSJ1VxnXFa/XDFLf07HvM90pALIJFgrO+UVaajI3+aJMMpojoUTLZyQ7JQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.18.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz", + "integrity": "sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-abstract": { + "version": "1.23.9", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.9.tgz", + "integrity": "sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.0", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.2", + "is-regex": "^1.2.1", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.0", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.3", + "object-keys": "^1.1.1", + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.3", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.18" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-iterator-helpers": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.2.1.tgz", + "integrity": "sha512-uDn+FE1yrDzyC0pCo961B2IHbdM8y/ACZsKD4dG6WqrjV53BADjwa7D+1aom2rsNVfLyDgU/eigvlJGJ08OQ4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.6", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "iterator.prototype": "^1.1.4", + "safe-array-concat": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", + "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-to-primitive": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/esbuild": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.1.tgz", + "integrity": "sha512-BGO5LtrGC7vxnqucAe/rmvKdJllfGaYWdyABvyMoXQlfYMb2bbRuReWR5tEGE//4LcNJj9XrkovTqNYRFZHAMQ==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.1", + "@esbuild/android-arm": "0.25.1", + "@esbuild/android-arm64": "0.25.1", + "@esbuild/android-x64": "0.25.1", + "@esbuild/darwin-arm64": "0.25.1", + "@esbuild/darwin-x64": "0.25.1", + "@esbuild/freebsd-arm64": "0.25.1", + "@esbuild/freebsd-x64": "0.25.1", + "@esbuild/linux-arm": "0.25.1", + "@esbuild/linux-arm64": "0.25.1", + "@esbuild/linux-ia32": "0.25.1", + "@esbuild/linux-loong64": "0.25.1", + "@esbuild/linux-mips64el": "0.25.1", + "@esbuild/linux-ppc64": "0.25.1", + "@esbuild/linux-riscv64": "0.25.1", + "@esbuild/linux-s390x": "0.25.1", + "@esbuild/linux-x64": "0.25.1", + "@esbuild/netbsd-arm64": "0.25.1", + "@esbuild/netbsd-x64": "0.25.1", + "@esbuild/openbsd-arm64": "0.25.1", + "@esbuild/openbsd-x64": "0.25.1", + "@esbuild/sunos-x64": "0.25.1", + "@esbuild/win32-arm64": "0.25.1", + "@esbuild/win32-ia32": "0.25.1", + "@esbuild/win32-x64": "0.25.1" + } + }, + "node_modules/esbuild-visualizer": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/esbuild-visualizer/-/esbuild-visualizer-0.7.0.tgz", + "integrity": "sha512-Vz22k+G2WT7GuCo7rbhaQwGbZ26lEhwzsctkEdQlu2SVrshoM4hzQeRpu/3DP596a9+9K2JyYsinuC6AC896Og==", + "dev": true, + "license": "MIT", + "dependencies": { + "open": "^8.4.0", + "picomatch": "^4.0.0", + "yargs": "^17.6.2" + }, + "bin": { + "esbuild-visualizer": "dist/bin/cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild-visualizer/node_modules/define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/esbuild-visualizer/node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/esbuild-visualizer/node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/esbuild-visualizer/node_modules/open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/esbuild-visualizer/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "dev": true, + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/eslint": { + "version": "9.20.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.20.1.tgz", + "integrity": "sha512-m1mM33o6dBUjxl2qb6wv6nGNwCAsns1eKtaQ4l/NPHeTvhiUPbtdfMyktxN4B3fgHIgsYh1VT3V9txblpQHq+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.0", + "@eslint/core": "^0.11.0", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "9.20.0", + "@eslint/plugin-kit": "^0.2.5", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.1", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint-import-resolver-typescript": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.7.0.tgz", + "integrity": "sha512-Vrwyi8HHxY97K5ebydMtffsWAn1SCR9eol49eCd5fJS4O1WV7PaAjbcjmbfJJSMz/t4Mal212Uz/fQZrOB8mow==", + "dev": true, + "license": "ISC", + "dependencies": { + "@nolyfill/is-core-module": "1.0.39", + "debug": "^4.3.7", + "enhanced-resolve": "^5.15.0", + "fast-glob": "^3.3.2", + "get-tsconfig": "^4.7.5", + "is-bun-module": "^1.0.2", + "is-glob": "^4.0.3", + "stable-hash": "^0.0.4" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts" + }, + "peerDependencies": { + "eslint": "*", + "eslint-plugin-import": "*", + "eslint-plugin-import-x": "*" + }, + "peerDependenciesMeta": { + "eslint-plugin-import": { + "optional": true + }, + "eslint-plugin-import-x": { + "optional": true + } + } + }, + "node_modules/eslint-import-resolver-typescript/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/eslint-import-resolver-typescript/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint-module-utils": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz", + "integrity": "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7" + }, + "engines": { + "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint-plugin-import": { + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", + "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rtsao/scc": "^1.1.0", + "array-includes": "^3.1.8", + "array.prototype.findlastindex": "^1.2.5", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.12.0", + "hasown": "^2.0.2", + "is-core-module": "^2.15.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.8", + "object.groupby": "^1.0.3", + "object.values": "^1.2.0", + "semver": "^6.3.1", + "string.prototype.trimend": "^1.0.8", + "tsconfig-paths": "^3.15.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint-plugin-jest": { + "version": "28.11.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.11.0.tgz", + "integrity": "sha512-QAfipLcNCWLVocVbZW8GimKn5p5iiMcgGbRzz8z/P5q7xw+cNEpYqyzFMtIF/ZgF2HLOyy+dYBut+DoYolvqig==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/utils": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "engines": { + "node": "^16.10.0 || ^18.12.0 || >=20.0.0" + }, + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^6.0.0 || ^7.0.0 || ^8.0.0", + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0", + "jest": "*" + }, + "peerDependenciesMeta": { + "@typescript-eslint/eslint-plugin": { + "optional": true + }, + "jest": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-react": { + "version": "7.37.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.4.tgz", + "integrity": "sha512-BGP0jRmfYyvOyvMoRX/uoUeW+GqNj9y16bPQzqAHf3AYII/tDs+jMN0dBVkl88/OZwNGwrVFxE7riHsXVfy/LQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.8", + "array.prototype.findlast": "^1.2.5", + "array.prototype.flatmap": "^1.3.3", + "array.prototype.tosorted": "^1.1.4", + "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.2.1", + "estraverse": "^5.3.0", + "hasown": "^2.0.2", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.8", + "object.fromentries": "^2.0.8", + "object.values": "^1.2.1", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.5", + "semver": "^6.3.1", + "string.prototype.matchall": "^4.0.12", + "string.prototype.repeat": "^1.0.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" + } + }, + "node_modules/eslint-plugin-react/node_modules/resolve": { + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/eslint-scope": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/espree": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.14.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/fast-check": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.0.0.tgz", + "integrity": "sha512-aXLyLemZ7qhLNn2oq+YpjT2Xed21+i29WGAYuyrGbU4r8oinB3i4XR4e62O3NY6qmm5qHEDoc/7d+gMsri3AfA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT", + "dependencies": { + "pure-rand": "^7.0.0" + }, + "engines": { + "node": ">=12.17.0" + } + }, + "node_modules/fast-check/node_modules/pure-rand": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-7.0.1.tgz", + "integrity": "sha512-oTUZM/NAZS8p7ANR3SHh30kXB+zK2r2BPcEn/awJIbOvq82WoMN4p62AWWp3Hhw50G0xMsw1mhIBLqHw64EcNQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ], + "license": "MIT" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "dev": true, + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", + "dev": true, + "license": "ISC" + }, + "node_modules/flow-bin": { + "version": "0.160.0", + "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.160.0.tgz", + "integrity": "sha512-hqb/1z7U9Jv+2hDdslAgdab6D4AUDrYIcF2zH/CKx9YgQtCeHfnzCcypzCNU7xmBm2+Mi9+1hqeB4OQX2adh0A==", + "dev": true, + "bin": { + "flow": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "dependencies": { + "is-callable": "^1.1.3" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/function.prototype.name": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", + "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "function-bind": "^1.1.2", + "get-proto": "^1.0.0", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-symbol-description": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-tsconfig": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.0.tgz", + "integrity": "sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globals": { + "version": "15.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz", + "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, + "license": "MIT" + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "node_modules/html-encoding-sniffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", + "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", + "dev": true, + "dependencies": { + "whatwg-encoding": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "dev": true, + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/http-proxy-agent/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/http-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "dev": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/internal-slot": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "node_modules/is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-bigints": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bun-module": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-1.3.0.tgz", + "integrity": "sha512-DgXeu5UWI0IsMQundYb5UAOzm6G2eVnarJ0byP6Tm55iZNKceD59LNPA2L4VvsScTtHcw0yEkVwSf7PC+QoLSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.6.3" + } + }, + "node_modules/is-bun-module/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "license": "MIT", + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-view": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "is-typed-array": "^1.1.13" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "dev": true, + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/is-generator-function": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", + "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true + }, + "node_modules/is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-string": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-wsl": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", + "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/istanbul-lib-report/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps/node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/istanbul-lib-source-maps/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/istanbul-reports": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/iterator.prototype": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.5.tgz", + "integrity": "sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "get-proto": "^1.0.0", + "has-symbols": "^1.1.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/jest": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.6.4.tgz", + "integrity": "sha512-tEFhVQFF/bzoYV1YuGyzLPZ6vlPrdfvDmmAxudA1dLEuiztqg2Rkx20vkKY32xiDROcD2KXlgZ7Cu8RPeEHRKw==", + "dev": true, + "dependencies": { + "@jest/core": "^29.6.4", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.6.4" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-changed-files": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.6.3.tgz", + "integrity": "sha512-G5wDnElqLa4/c66ma5PG9eRjE342lIbF6SUnTJi26C3J28Fv2TVY2rOyKB9YGbSA5ogwevgmxc4j4aVjrEK6Yg==", + "dev": true, + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.6.3", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.6.4.tgz", + "integrity": "sha512-YXNrRyntVUgDfZbjXWBMPslX1mQ8MrSG0oM/Y06j9EYubODIyHWP8hMUbjbZ19M3M+zamqEur7O80HODwACoJw==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.6.4", + "@jest/expect": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.6.3", + "jest-matcher-utils": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-runtime": "^29.6.4", + "jest-snapshot": "^29.6.4", + "jest-util": "^29.6.3", + "p-limit": "^3.1.0", + "pretty-format": "^29.6.3", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-cli": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.6.4.tgz", + "integrity": "sha512-+uMCQ7oizMmh8ZwRfZzKIEszFY9ksjjEQnTEMTaL7fYiL3Kw4XhqT9bYh+A4DQKUb67hZn2KbtEnDuHvcgK4pQ==", + "dev": true, + "dependencies": { + "@jest/core": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "import-local": "^3.0.2", + "jest-config": "^29.6.4", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "prompts": "^2.0.1", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-config": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.6.4.tgz", + "integrity": "sha512-JWohr3i9m2cVpBumQFv2akMEnFEPVOh+9L2xIBJhJ0zOaci2ZXuKJj0tgMKQCBZAKA09H049IR4HVS/43Qb19A==", + "dev": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.6.4", + "@jest/types": "^29.6.3", + "babel-jest": "^29.6.4", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.6.4", + "jest-environment-node": "^29.6.4", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-runner": "^29.6.4", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.6.3", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-config/node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-docblock": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.6.3.tgz", + "integrity": "sha512-2+H+GOTQBEm2+qFSQ7Ma+BvyV+waiIFxmZF5LdpBsAEjWX8QYjSCa4FrkIYtbfXUJJJnFCYrOtt6TZ+IAiTjBQ==", + "dev": true, + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.6.3.tgz", + "integrity": "sha512-KoXfJ42k8cqbkfshW7sSHcdfnv5agDdHCPA87ZBdmHP+zJstTJc0ttQaJ/x7zK6noAL76hOuTIJ6ZkQRS5dcyg==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.6.3", + "pretty-format": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-environment-jsdom": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-29.6.4.tgz", + "integrity": "sha512-K6wfgUJ16DoMs02JYFid9lOsqfpoVtyJxpRlnTxUHzvZWBnnh2VNGRB9EC1Cro96TQdq5TtSjb3qUjNaJP9IyA==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.6.4", + "@jest/fake-timers": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/jsdom": "^20.0.0", + "@types/node": "*", + "jest-mock": "^29.6.3", + "jest-util": "^29.6.3", + "jsdom": "^20.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jest-environment-node": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.6.4.tgz", + "integrity": "sha512-i7SbpH2dEIFGNmxGCpSc2w9cA4qVD+wfvg2ZnfQ7XVrKL0NA5uDVBIiGH8SR4F0dKEv/0qI5r+aDomDf04DpEQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.6.4", + "@jest/fake-timers": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.6.3", + "jest-util": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/jest-leak-detector": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.6.3.tgz", + "integrity": "sha512-0kfbESIHXYdhAdpLsW7xdwmYhLf1BRu4AA118/OxFm0Ho1b2RcTmO4oF6aAMaxpxdxnJ3zve2rgwzNBD4Zbm7Q==", + "dev": true, + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-message-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.6.4.tgz", + "integrity": "sha512-fPRq+0vcxsuGlG0O3gyoqGTAxasagOxEuyoxHeyxaZbc9QNek0AmJWSkhjlMG+mTsj+8knc/mWb3fXlRNVih7Q==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.4.tgz", + "integrity": "sha512-7+6eAmr1ZBF3vOAJVsfLj1QdqeXG+WYhidfLHBRZqGN24MFRIiKG20ItpLw2qRAsW/D2ZUUmCNf6irUr/v6KHA==", + "dev": true, + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.6.4" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.6.4.tgz", + "integrity": "sha512-SDaLrMmtVlQYDuG0iSPYLycG8P9jLI+fRm8AF/xPKhYDB2g6xDWjXBrR5M8gEWsK6KVFlebpZ4QsrxdyIX1Jaw==", + "dev": true, + "dependencies": { + "@jest/console": "^29.6.4", + "@jest/environment": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.6.3", + "jest-environment-node": "^29.6.4", + "jest-haste-map": "^29.6.4", + "jest-leak-detector": "^29.6.3", + "jest-message-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-runtime": "^29.6.4", + "jest-util": "^29.6.3", + "jest-watcher": "^29.6.4", + "jest-worker": "^29.6.4", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner/node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/jest-runtime": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.6.4.tgz", + "integrity": "sha512-s/QxMBLvmwLdchKEjcLfwzP7h+jsHvNEtxGP5P+Fl1FMaJX2jMiIqe4rJw4tFprzCwuSvVUo9bn0uj4gNRXsbA==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.6.4", + "@jest/fake-timers": "^29.6.4", + "@jest/globals": "^29.6.4", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-mock": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-snapshot": "^29.6.4", + "jest-util": "^29.6.3", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.6.3.tgz", + "integrity": "sha512-e7KWZcAIX+2W1o3cHfnqpGajdCs1jSM3DkXjGeLSNmCazv1EeI1ggTeK5wdZhF+7N+g44JI2Od3veojoaumlfg==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-watcher": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.6.4.tgz", + "integrity": "sha512-oqUWvx6+On04ShsT00Ir9T4/FvBeEh2M9PTubgITPxDa739p4hoQweWPRGyYeaojgT0xTpZKF0Y/rSY1UgMxvQ==", + "dev": true, + "dependencies": { + "@jest/test-result": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.6.3", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/jiti": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.4.2.tgz", + "integrity": "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsdom": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz", + "integrity": "sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==", + "dev": true, + "dependencies": { + "abab": "^2.0.6", + "acorn": "^8.8.1", + "acorn-globals": "^7.0.0", + "cssom": "^0.5.0", + "cssstyle": "^2.3.0", + "data-urls": "^3.0.2", + "decimal.js": "^10.4.2", + "domexception": "^4.0.0", + "escodegen": "^2.0.0", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.1", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.2", + "parse5": "^7.1.1", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.1.2", + "w3c-xmlserializer": "^4.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0", + "ws": "^8.11.0", + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jsdom/node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/jsdom/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/jsdom/node_modules/tough-cookie": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", + "dev": true, + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsdom/node_modules/universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true, + "license": "ISC" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonml-html": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/jsonml-html/-/jsonml-html-1.2.0.tgz", + "integrity": "sha512-vg30gQFD5X+1nY3do43BW9Iiq4F5BZcysXc+ydPNu7O5AxaqxnaI9ikjTjlE9y9KaAvgTwTP6nOpifDqDoYmjg==", + "dev": true, + "license": "ISC" + }, + "node_modules/jsx-ast-utils": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", + "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/junk": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/junk/-/junk-4.0.1.tgz", + "integrity": "sha512-Qush0uP+G8ZScpGMZvHUiRfI0YBWuB3gVBYlI0v0vvOJt5FLicco+IkP0a50LqTTQhmts/m6tP5SWE+USyIvcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "node_modules/lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "node_modules/load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/load-json-file/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/magic-string": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", + "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "sourcemap-codec": "^1.4.8" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true, + "license": "ISC" + }, + "node_modules/make-synchronous": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/make-synchronous/-/make-synchronous-0.1.1.tgz", + "integrity": "sha512-Y4SxxqhaoyMDokJQ0AZz0E+bLhRkOSR7Z/IQoTKPdS6HYi3aobal2kMHoHHoqBadPWjf07P4K1FQLXOx3wf9Yw==", + "dev": true, + "dependencies": { + "subsume": "^3.0.0", + "type-fest": "^0.16.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-synchronous/node_modules/type-fest": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.16.0.tgz", + "integrity": "sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/marked": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-11.2.0.tgz", + "integrity": "sha512-HR0m3bvu0jAPYiIvLUUQtdg1g6D247//lvcekpHO1WMvbwDlwSkZAX9Lw4F4YHE1T0HaaNve0tuAWuV1UJ6vtw==", + "dev": true, + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/marked-highlight": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/marked-highlight/-/marked-highlight-2.1.0.tgz", + "integrity": "sha512-peBvgGZZqUw074Vy/N8Y7/6JQhSnR54/T0Ozq2/fAIBzcYfVfExFdQJptIhQxreR1elpwvJRrqhp6S/Prk8prA==", + "dev": true, + "peerDependencies": { + "marked": ">=4 <12" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/meow": { + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", + "integrity": "sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16.10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/microtime": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/microtime/-/microtime-3.1.1.tgz", + "integrity": "sha512-to1r7o24cDsud9IhN6/8wGmMx5R2kT0w2Xwm5okbYI3d1dk6Xv0m+Z+jg2vS9pt+ocgQHTCtgs/YuyJhySzxNg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "node-addon-api": "^5.0.0", + "node-gyp-build": "^4.4.0" + }, + "engines": { + "node": ">= 14.13.0" + } + }, + "node_modules/mime-db": { + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz", + "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.32", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz", + "integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==", + "dev": true, + "dependencies": { + "mime-db": "1.49.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/nanoid": { + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.10.tgz", + "integrity": "sha512-vSJJTG+t/dIKAUhUDw/dLdZ9s//5OxcHqLaDWWrW4Cdq7o6tdLIczUkMXt2MBNmk6sJRZBZRXVixs7URY1CmIg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/nanospinner": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/nanospinner/-/nanospinner-1.2.2.tgz", + "integrity": "sha512-Zt/AmG6qRU3e+WnzGGLuMCEAO/dAu45stNbHY223tUxldaDAeE+FxSPsd9Q+j+paejmm0ZbrNVs5Sraqy3dRxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picocolors": "^1.1.1" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "node_modules/nested-error-stacks": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.1.tgz", + "integrity": "sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==", + "dev": true, + "license": "MIT" + }, + "node_modules/next": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/next/-/next-15.2.4.tgz", + "integrity": "sha512-VwL+LAaPSxEkd3lU2xWbgEOtrM8oedmyhBqaVNmgKB+GvZlCy9rgaEc+y2on0wv+l0oSFqLtYD6dcC1eAedUaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@next/env": "15.2.4", + "@swc/counter": "0.1.3", + "@swc/helpers": "0.5.15", + "busboy": "1.6.0", + "caniuse-lite": "^1.0.30001579", + "postcss": "8.4.31", + "styled-jsx": "5.1.6" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": "^18.18.0 || ^19.8.0 || >= 20.0.0" + }, + "optionalDependencies": { + "@next/swc-darwin-arm64": "15.2.4", + "@next/swc-darwin-x64": "15.2.4", + "@next/swc-linux-arm64-gnu": "15.2.4", + "@next/swc-linux-arm64-musl": "15.2.4", + "@next/swc-linux-x64-gnu": "15.2.4", + "@next/swc-linux-x64-musl": "15.2.4", + "@next/swc-win32-arm64-msvc": "15.2.4", + "@next/swc-win32-x64-msvc": "15.2.4", + "sharp": "^0.33.5" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0", + "@playwright/test": "^1.41.2", + "babel-plugin-react-compiler": "*", + "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", + "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "@playwright/test": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, + "node_modules/next-sitemap": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/next-sitemap/-/next-sitemap-4.2.3.tgz", + "integrity": "sha512-vjdCxeDuWDzldhCnyFCQipw5bfpl4HmZA7uoo3GAaYGjGgfL4Cxb1CiztPuWGmS+auYs7/8OekRS8C2cjdAsjQ==", + "dev": true, + "funding": [ + { + "url": "https://github.com/iamvishnusankar/next-sitemap.git" + } + ], + "dependencies": { + "@corex/deepmerge": "^4.0.43", + "@next/env": "^13.4.3", + "fast-glob": "^3.2.12", + "minimist": "^1.2.8" + }, + "bin": { + "next-sitemap": "bin/next-sitemap.mjs", + "next-sitemap-cjs": "bin/next-sitemap.cjs" + }, + "engines": { + "node": ">=14.18" + }, + "peerDependencies": { + "next": "*" + } + }, + "node_modules/next-sitemap/node_modules/@next/env": { + "version": "13.5.8", + "resolved": "https://registry.npmjs.org/@next/env/-/env-13.5.8.tgz", + "integrity": "sha512-YmiG58BqyZ2FjrF2+5uZExL2BrLr8RTQzLXNDJ8pJr0O+rPlOeDPXp1p1/4OrR3avDidzZo3D8QO2cuDv1KCkw==", + "dev": true, + "license": "MIT" + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node_modules/node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-gyp-build": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.2.tgz", + "integrity": "sha512-IRUxE4BVsHWXkV/SFOut4qTlagw2aM8T5/vnTsmrHJvVoKueJHRc/JaFND7QDDc61kLYUJ6qlZM3sqTSyx2dTw==", + "dev": true, + "license": "MIT", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true + }, + "node_modules/node-releases": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "dev": true, + "license": "MIT" + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "bin": { + "npm-run-all": "bin/npm-run-all/index.js", + "run-p": "bin/run-p/index.js", + "run-s": "bin/run-s/index.js" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/npm-run-all/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/npm-run-all/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "license": "MIT" + }, + "node_modules/npm-run-all/node_modules/cross-spawn": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/npm-run-all/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/npm-run-all/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/npm-run-all/node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all/node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-all/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npm-run-all/node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nwsapi": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", + "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==", + "dev": true + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.entries": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", + "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.values": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", + "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/open": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/open/-/open-10.1.0.tgz", + "integrity": "sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "default-browser": "^5.2.1", + "define-lazy-prop": "^3.0.0", + "is-inside-container": "^1.0.0", + "is-wsl": "^3.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/p-event": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-5.0.1.tgz", + "integrity": "sha512-dd589iCQ7m1L0bmC5NLlVYfy3TbBEsMUfWx9PyAgPeIcFZ/E2yaTZ4Rz4MiBmmJShviiftHVXOqfnfzJ6kyMrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-timeout": "^5.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-3.0.0.tgz", + "integrity": "sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-map": "^5.1.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-filter/node_modules/p-map": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", + "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", + "dev": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-6.0.0.tgz", + "integrity": "sha512-T8BatKGY+k5rU+Q/GTYgrEf2r4xRMevAN5mtXc2aPc4rS1j3s+vWTaO2Wag94neXuCAUAs8cxBL9EeB5EA6diw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-timeout": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", + "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "license": "MIT", + "dependencies": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dev": true, + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "dev": true, + "bin": { + "pidtree": "bin/pidtree.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/platform": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", + "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==", + "dev": true + }, + "node_modules/possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/postcss": { + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.0.tgz", + "integrity": "sha512-quyMrVt6svPS7CjQ9gKb3GLEX/rl3BCL2oa/QkNcXv4YNVBC9olt3s+H7ukto06q7B1Qz46PbrKLO34PR6vXcA==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/pretty-format/node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true, + "license": "MIT" + }, + "node_modules/prismjs": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz", + "integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dev": true, + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/pure-rand": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.2.tgz", + "integrity": "sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ] + }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/random-seed": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/random-seed/-/random-seed-0.3.0.tgz", + "integrity": "sha512-y13xtn3kcTlLub3HKWXxJNeC2qK4mB59evwZ5EkeRlolx+Bp2ztF7LbcZmyCnOqlHQrLnfuNbi1sVmm9lPDlDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "json-stringify-safe": "^5.0.1" + }, + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/react": { + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz", + "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.0.tgz", + "integrity": "sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "scheduler": "^0.26.0" + }, + "peerDependencies": { + "react": "^19.1.0" + } + }, + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "dev": true, + "license": "MIT", + "dependencies": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/read-pkg/node_modules/path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "dependencies": { + "pify": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true + }, + "node_modules/regenerate-unicode-properties": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", + "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", + "dev": true, + "dependencies": { + "regenerate": "^1.4.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/regexp.prototype.flags": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regjsgen": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", + "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", + "dev": true + }, + "node_modules/regjsparser": { + "version": "0.6.9", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz", + "integrity": "sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ==", + "dev": true, + "dependencies": { + "jsesc": "~0.5.0" + }, + "bin": { + "regjsparser": "bin/parser" + } + }, + "node_modules/regjsparser/node_modules/jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true + }, + "node_modules/resolve": { + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.16.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-cwd/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/resolve.exports": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/rollup": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.34.8.tgz", + "integrity": "sha512-489gTVMzAYdiZHFVA/ig/iYFllCcWFHMvUHI1rpFmkoUtRlQxqh6/yiNqnYibjMZ2b/+FUQwldG+aLsEt6bglQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.6" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.34.8", + "@rollup/rollup-android-arm64": "4.34.8", + "@rollup/rollup-darwin-arm64": "4.34.8", + "@rollup/rollup-darwin-x64": "4.34.8", + "@rollup/rollup-freebsd-arm64": "4.34.8", + "@rollup/rollup-freebsd-x64": "4.34.8", + "@rollup/rollup-linux-arm-gnueabihf": "4.34.8", + "@rollup/rollup-linux-arm-musleabihf": "4.34.8", + "@rollup/rollup-linux-arm64-gnu": "4.34.8", + "@rollup/rollup-linux-arm64-musl": "4.34.8", + "@rollup/rollup-linux-loongarch64-gnu": "4.34.8", + "@rollup/rollup-linux-powerpc64le-gnu": "4.34.8", + "@rollup/rollup-linux-riscv64-gnu": "4.34.8", + "@rollup/rollup-linux-s390x-gnu": "4.34.8", + "@rollup/rollup-linux-x64-gnu": "4.34.8", + "@rollup/rollup-linux-x64-musl": "4.34.8", + "@rollup/rollup-win32-arm64-msvc": "4.34.8", + "@rollup/rollup-win32-ia32-msvc": "4.34.8", + "@rollup/rollup-win32-x64-msvc": "4.34.8", + "fsevents": "~2.3.2" + } + }, + "node_modules/run-applescript": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz", + "integrity": "sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-array-concat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">=0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-array-concat/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-push-apply/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, + "node_modules/scheduler": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz", + "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/sharp": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz", + "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "color": "^4.2.3", + "detect-libc": "^2.0.3", + "semver": "^7.6.3" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.33.5", + "@img/sharp-darwin-x64": "0.33.5", + "@img/sharp-libvips-darwin-arm64": "1.0.4", + "@img/sharp-libvips-darwin-x64": "1.0.4", + "@img/sharp-libvips-linux-arm": "1.0.5", + "@img/sharp-libvips-linux-arm64": "1.0.4", + "@img/sharp-libvips-linux-s390x": "1.0.4", + "@img/sharp-libvips-linux-x64": "1.0.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", + "@img/sharp-libvips-linuxmusl-x64": "1.0.4", + "@img/sharp-linux-arm": "0.33.5", + "@img/sharp-linux-arm64": "0.33.5", + "@img/sharp-linux-s390x": "0.33.5", + "@img/sharp-linux-x64": "0.33.5", + "@img/sharp-linuxmusl-arm64": "0.33.5", + "@img/sharp-linuxmusl-x64": "0.33.5", + "@img/sharp-wasm32": "0.33.5", + "@img/sharp-win32-ia32": "0.33.5", + "@img/sharp-win32-x64": "0.33.5" + } + }, + "node_modules/sharp/node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "optional": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/shell-quote": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.2.tgz", + "integrity": "sha512-AzqKpGKjrj7EM6rKVQEPpB288oCfnrEIuyoT9cyF4nmGa7V8Zk6f7RRqYisX8X9m+Q7bd632aZW4ky7EhbQztA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/simple-swizzle/node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "node_modules/size-limit": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/size-limit/-/size-limit-11.2.0.tgz", + "integrity": "sha512-2kpQq2DD/pRpx3Tal/qRW1SYwcIeQ0iq8li5CJHQgOC+FtPn2BVmuDtzUCgNnpCrbgtfEHqh+iWzxK+Tq6C+RQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bytes-iec": "^3.1.1", + "chokidar": "^4.0.3", + "jiti": "^2.4.2", + "lilconfig": "^3.1.3", + "nanospinner": "^1.2.2", + "picocolors": "^1.1.1", + "tinyglobby": "^0.2.11" + }, + "bin": { + "size-limit": "bin.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/smob": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/smob/-/smob-1.4.0.tgz", + "integrity": "sha512-MqR3fVulhjWuRNSMydnTlweu38UhQ0HXM4buStD/S3mc/BzX3CuM9OmhyQpmtYCvoYdl5ris6TI0ZqH355Ymqg==", + "dev": true + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "dev": true + }, + "node_modules/spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz", + "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==", + "dev": true + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "node_modules/stable-hash": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/stable-hash/-/stable-hash-0.0.4.tgz", + "integrity": "sha512-LjdcbuBeLcdETCrPn9i8AYAZ1eCtu4ECAWtP7UleOiZ9LzVxRzzUZEoZ8zB24nhkQnDWyET0I+3sWokSDS3E7g==", + "dev": true, + "license": "MIT" + }, + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string.prototype.matchall": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz", + "integrity": "sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "regexp.prototype.flags": "^1.5.3", + "set-function-name": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.padend": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.2.tgz", + "integrity": "sha512-/AQFLdYvePENU3W5rgurfWSMU6n+Ww8n/3cUt7E+vPBB/D7YDG8x+qjoFs4M/alR2bW7Qg6xMjVwWUOvuQ0XpQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.repeat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz", + "integrity": "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "node_modules/string.prototype.trim": { + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/style-mod": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.2.tgz", + "integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==", + "dev": true, + "license": "MIT" + }, + "node_modules/styled-jsx": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.6.tgz", + "integrity": "sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "client-only": "0.0.1" + }, + "engines": { + "node": ">= 12.0.0" + }, + "peerDependencies": { + "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/subsume": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/subsume/-/subsume-3.0.0.tgz", + "integrity": "sha512-6n/UfV8UWKwJNO8OAOiKntwEMihuBeeoJfzpL542C+OuvT4iWG9SwjrXkOmsxjb4SteHUsos9SvrdqZ9+ICwTQ==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^2.0.0", + "unique-string": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/subsume/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true + }, + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/terser": { + "version": "5.19.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.2.tgz", + "integrity": "sha512-qC5+dmecKJA4cpYxRa5aVkKehYsQKc+AHeKl0Oe62aYjBL8ZA33tTljktDHJSaxxMnbI5ZYw+o/S2DxxLu8OfA==", + "dev": true, + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser/node_modules/acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", + "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.4.3", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", + "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tr46": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "dev": true, + "dependencies": { + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/transducers-js": { + "version": "0.4.174", + "resolved": "https://registry.npmjs.org/transducers-js/-/transducers-js-0.4.174.tgz", + "integrity": "sha1-1YYsEO/0vj0zIqv2u3QuMPG7b8Q=", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/ts-api-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", + "integrity": "sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/acorn": { + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/tsconfig-paths/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" + }, + "node_modules/tstyche": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/tstyche/-/tstyche-3.5.0.tgz", + "integrity": "sha512-N4SUp/ZWaMGEcglpVFIzKez0GQEiBdfFDgcnqwv9O1mePZgos8N1cZCzNgGtPGo/w0ym04MjJcDnsw1sorEzgA==", + "dev": true, + "license": "MIT", + "bin": { + "tstyche": "build/bin.js" + }, + "engines": { + "node": ">=18.19" + }, + "funding": { + "url": "https://github.com/tstyche/tstyche?sponsor=1" + }, + "peerDependencies": { + "typescript": "4.x || 5.x" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/typed-array-byte-length": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-byte-offset": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typed-array-length": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/typescript": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typescript-eslint": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.24.0.tgz", + "integrity": "sha512-/lmv4366en/qbB32Vz5+kCNZEMf6xYHwh1z48suBwZvAtnXKbP+YhGe8OLE2BqC67LMqKkCNLtjejdwsdW6uOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.24.0", + "@typescript-eslint/parser": "8.24.0", + "@typescript-eslint/utils": "8.24.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" + } + }, + "node_modules/unbox-primitive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.3", + "has-bigints": "^1.0.2", + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "dependencies": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-match-property-value-ecmascript": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", + "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/unicode-property-aliases-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", + "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dev": true, + "dependencies": { + "crypto-random-string": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz", + "integrity": "sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true, + "license": "MIT" + }, + "node_modules/v8-to-istanbul": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", + "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/w3c-keyname": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", + "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/w3c-xmlserializer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", + "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", + "dev": true, + "dependencies": { + "xml-name-validator": "^4.0.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "dependencies": { + "makeerror": "1.0.12" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-encoding": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", + "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", + "dev": true, + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-mimetype": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-url": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "dev": true, + "dependencies": { + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-builtin-type/node_modules/isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true, + "license": "MIT" + }, + "node_modules/which-collection": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/which-typed-array": { + "version": "1.1.18", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.18.tgz", + "integrity": "sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xml-name-validator": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + }, + "dependencies": { + "@ampproject/remapping": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@babel/code-frame": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + } + }, + "@babel/compat-data": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.26.8.tgz", + "integrity": "sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==", + "dev": true + }, + "@babel/core": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.8.tgz", + "integrity": "sha512-l+lkXCHS6tQEc5oUpK28xBOZ6+HwaH7YwoYQbLFiYb4nS2/l1tKnZEtEWkD0GuiYdvArf9qBS0XlQGXzPMsNqQ==", + "dev": true, + "requires": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.8", + "@babel/helper-compilation-targets": "^7.26.5", + "@babel/helper-module-transforms": "^7.26.0", + "@babel/helpers": "^7.26.7", + "@babel/parser": "^7.26.8", + "@babel/template": "^7.26.8", + "@babel/traverse": "^7.26.8", + "@babel/types": "^7.26.8", + "@types/gensync": "^1.0.0", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "dependencies": { + "convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.8.tgz", + "integrity": "sha512-ef383X5++iZHWAXX0SXQR6ZyQhw/0KtTkrTz61WXRhFM6dhpHulO/RJz79L8S6ugZHJkOOkUrUdxgdF2YiPFnA==", + "dev": true, + "requires": { + "@babel/parser": "^7.26.8", + "@babel/types": "^7.26.8", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", + "jsesc": "^3.0.2" + } + }, + "@babel/helper-compilation-targets": { + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.26.5.tgz", + "integrity": "sha512-IXuyn5EkouFJscIDuFF5EsiSolseme1s0CZB+QxVugqJLYmKdxI1VfIBOst0SUu4rnk2Z7kqTwmoO1lp3HIfnA==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.26.5", + "@babel/helper-validator-option": "^7.25.9", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "dependencies": { + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + } + } + }, + "@babel/helper-module-imports": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", + "dev": true, + "requires": { + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" + } + }, + "@babel/helper-module-transforms": { + "version": "7.26.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.26.0.tgz", + "integrity": "sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "dev": true + }, + "@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "dev": true + }, + "@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "dev": true + }, + "@babel/helper-validator-option": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", + "dev": true + }, + "@babel/helpers": { + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.10.tgz", + "integrity": "sha512-UPYc3SauzZ3JGgj87GgZ89JVdC5dj0AoetR5Bw6wj4niittNyFh6+eOGonYvJ1ao6B8lEa3Q3klS7ADZ53bc5g==", + "dev": true, + "requires": { + "@babel/template": "^7.26.9", + "@babel/types": "^7.26.10" + } + }, + "@babel/parser": { + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.10.tgz", + "integrity": "sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA==", + "dev": true, + "requires": { + "@babel/types": "^7.26.10" + } + }, + "@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.12.13" + } + }, + "@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-jsx": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", + "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5" + } + }, + "@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.4" + } + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.14.5" + } + }, + "@babel/plugin-syntax-typescript": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", + "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5" + } + }, + "@babel/template": { + "version": "7.26.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz", + "integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.26.2", + "@babel/parser": "^7.26.9", + "@babel/types": "^7.26.9" + } + }, + "@babel/traverse": { + "version": "7.26.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.8.tgz", + "integrity": "sha512-nic9tRkjYH0oB2dzr/JoGIm+4Q6SuYeLEiIiZDwBscRMYFJ+tMAz98fuel9ZnbXViA2I0HVSSRRK8DW5fjXStA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.26.2", + "@babel/generator": "^7.26.8", + "@babel/parser": "^7.26.8", + "@babel/template": "^7.26.8", + "@babel/types": "^7.26.8", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.26.10", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.10.tgz", + "integrity": "sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==", + "dev": true, + "requires": { + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" + } + }, + "@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "@codemirror/autocomplete": { + "version": "6.18.6", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.6.tgz", + "integrity": "sha512-PHHBXFomUs5DF+9tCOM/UoW6XQ4R44lLNNhRaW9PKPTU0D7lIjRg3ElxaJnTwsl/oHiR93WSXDBrekhoUGCPtg==", + "dev": true, + "requires": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.17.0", + "@lezer/common": "^1.0.0" + } + }, + "@codemirror/commands": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.8.1.tgz", + "integrity": "sha512-KlGVYufHMQzxbdQONiLyGQDUW0itrLZwq3CcY7xpv9ZLRHqzkBSoteocBHtMCoY7/Ci4xhzSrToIeLg7FxHuaw==", + "dev": true, + "requires": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.4.0", + "@codemirror/view": "^6.27.0", + "@lezer/common": "^1.1.0" + } + }, + "@codemirror/lang-javascript": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.2.3.tgz", + "integrity": "sha512-8PR3vIWg7pSu7ur8A07pGiYHgy3hHj+mRYRCSG8q+mPIrl0F02rgpGv+DsQTHRTc30rydOsf5PZ7yjKFg2Ackw==", + "dev": true, + "requires": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/language": "^6.6.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.17.0", + "@lezer/common": "^1.0.0", + "@lezer/javascript": "^1.0.0" + } + }, + "@codemirror/language": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.11.0.tgz", + "integrity": "sha512-A7+f++LodNNc1wGgoRDTt78cOwWm9KVezApgjOMp1W4hM0898nsqBXwF+sbePE7ZRcjN7Sa1Z5m2oN27XkmEjQ==", + "dev": true, + "requires": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.23.0", + "@lezer/common": "^1.1.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.0.0", + "style-mod": "^4.0.0" + } + }, + "@codemirror/lint": { + "version": "6.8.5", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.8.5.tgz", + "integrity": "sha512-s3n3KisH7dx3vsoeGMxsbRAgKe4O1vbrnKBClm99PU0fWxmxsx5rR2PfqQgIt+2MMJBHbiJ5rfIdLYfB9NNvsA==", + "dev": true, + "requires": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.35.0", + "crelt": "^1.0.5" + } + }, + "@codemirror/search": { + "version": "6.5.10", + "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.10.tgz", + "integrity": "sha512-RMdPdmsrUf53pb2VwflKGHEe1XVM07hI7vV2ntgw1dmqhimpatSJKva4VA9h4TLUDOD4EIF02201oZurpnEFsg==", + "dev": true, + "requires": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "crelt": "^1.0.5" + } + }, + "@codemirror/state": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.5.2.tgz", + "integrity": "sha512-FVqsPqtPWKVVL3dPSxy8wEF/ymIEuVzF1PK3VbUgrxXpJUSHQWWZz4JMToquRxnkw+36LTamCZG2iua2Ptq0fA==", + "dev": true, + "requires": { + "@marijn/find-cluster-break": "^1.0.0" + } + }, + "@codemirror/theme-one-dark": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/@codemirror/theme-one-dark/-/theme-one-dark-6.1.2.tgz", + "integrity": "sha512-F+sH0X16j/qFLMAfbciKTxVOwkdAS336b7AXTKOZhy8BR3eH/RelsnLgLFINrpST63mmN2OuwUt0W2ndUgYwUA==", + "dev": true, + "requires": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/highlight": "^1.0.0" + } + }, + "@codemirror/view": { + "version": "6.36.5", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.36.5.tgz", + "integrity": "sha512-cd+FZEUlu3GQCYnguYm3EkhJ8KJVisqqUsCOKedBoAt/d9c76JUUap6U0UrpElln5k6VyrEOYliMuDAKIeDQLg==", + "dev": true, + "requires": { + "@codemirror/state": "^6.5.0", + "style-mod": "^4.1.0", + "w3c-keyname": "^2.2.4" + } + }, + "@corex/deepmerge": { + "version": "4.0.43", + "resolved": "https://registry.npmjs.org/@corex/deepmerge/-/deepmerge-4.0.43.tgz", + "integrity": "sha512-N8uEMrMPL0cu/bdboEWpQYb/0i2K5Qn8eCsxzOmxSggJbbQte7ljMRoXm917AbntqTGOzdTu+vP3KOOzoC70HQ==", + "dev": true + }, + "@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "dependencies": { + "@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + } + } + }, + "@emnapi/runtime": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.4.0.tgz", + "integrity": "sha512-64WYIf4UYcdLnbKn/umDlNjQDSS8AgZrI/R9+x5ilkUVFxXcA1Ebl+gQLc/6mERA4407Xof0R7wEyEuj091CVw==", + "dev": true, + "optional": true, + "requires": { + "tslib": "^2.4.0" + } + }, + "@esbuild/aix-ppc64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.1.tgz", + "integrity": "sha512-kfYGy8IdzTGy+z0vFGvExZtxkFlA4zAxgKEahG9KE1ScBjpQnFsNOX8KTU5ojNru5ed5CVoJYXFtoxaq5nFbjQ==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.1.tgz", + "integrity": "sha512-dp+MshLYux6j/JjdqVLnMglQlFu+MuVeNrmT5nk6q07wNhCdSnB7QZj+7G8VMUGh1q+vj2Bq8kRsuyA00I/k+Q==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.1.tgz", + "integrity": "sha512-50tM0zCJW5kGqgG7fQ7IHvQOcAn9TKiVRuQ/lN0xR+T2lzEFvAi1ZcS8DiksFcEpf1t/GYOeOfCAgDHFpkiSmA==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.1.tgz", + "integrity": "sha512-GCj6WfUtNldqUzYkN/ITtlhwQqGWu9S45vUXs7EIYf+7rCiiqH9bCloatO9VhxsL0Pji+PF4Lz2XXCES+Q8hDw==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.1.tgz", + "integrity": "sha512-5hEZKPf+nQjYoSr/elb62U19/l1mZDdqidGfmFutVUjjUZrOazAtwK+Kr+3y0C/oeJfLlxo9fXb1w7L+P7E4FQ==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.1.tgz", + "integrity": "sha512-hxVnwL2Dqs3fM1IWq8Iezh0cX7ZGdVhbTfnOy5uURtao5OIVCEyj9xIzemDi7sRvKsuSdtCAhMKarxqtlyVyfA==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.1.tgz", + "integrity": "sha512-1MrCZs0fZa2g8E+FUo2ipw6jw5qqQiH+tERoS5fAfKnRx6NXH31tXBKI3VpmLijLH6yriMZsxJtaXUyFt/8Y4A==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.1.tgz", + "integrity": "sha512-0IZWLiTyz7nm0xuIs0q1Y3QWJC52R8aSXxe40VUxm6BB1RNmkODtW6LHvWRrGiICulcX7ZvyH6h5fqdLu4gkww==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.1.tgz", + "integrity": "sha512-NdKOhS4u7JhDKw9G3cY6sWqFcnLITn6SqivVArbzIaf3cemShqfLGHYMx8Xlm/lBit3/5d7kXvriTUGa5YViuQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.1.tgz", + "integrity": "sha512-jaN3dHi0/DDPelk0nLcXRm1q7DNJpjXy7yWaWvbfkPvI+7XNSc/lDOnCLN7gzsyzgu6qSAmgSvP9oXAhP973uQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.1.tgz", + "integrity": "sha512-OJykPaF4v8JidKNGz8c/q1lBO44sQNUQtq1KktJXdBLn1hPod5rE/Hko5ugKKZd+D2+o1a9MFGUEIUwO2YfgkQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.1.tgz", + "integrity": "sha512-nGfornQj4dzcq5Vp835oM/o21UMlXzn79KobKlcs3Wz9smwiifknLy4xDCLUU0BWp7b/houtdrgUz7nOGnfIYg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.1.tgz", + "integrity": "sha512-1osBbPEFYwIE5IVB/0g2X6i1qInZa1aIoj1TdL4AaAb55xIIgbg8Doq6a5BzYWgr+tEcDzYH67XVnTmUzL+nXg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.1.tgz", + "integrity": "sha512-/6VBJOwUf3TdTvJZ82qF3tbLuWsscd7/1w+D9LH0W/SqUgM5/JJD0lrJ1fVIfZsqB6RFmLCe0Xz3fmZc3WtyVg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.1.tgz", + "integrity": "sha512-nSut/Mx5gnilhcq2yIMLMe3Wl4FK5wx/o0QuuCLMtmJn+WeWYoEGDN1ipcN72g1WHsnIbxGXd4i/MF0gTcuAjQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.1.tgz", + "integrity": "sha512-cEECeLlJNfT8kZHqLarDBQso9a27o2Zd2AQ8USAEoGtejOrCYHNtKP8XQhMDJMtthdF4GBmjR2au3x1udADQQQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.1.tgz", + "integrity": "sha512-xbfUhu/gnvSEg+EGovRc+kjBAkrvtk38RlerAzQxvMzlB4fXpCFCeUAYzJvrnhFtdeyVCDANSjJvOvGYoeKzFA==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.1.tgz", + "integrity": "sha512-O96poM2XGhLtpTh+s4+nP7YCCAfb4tJNRVZHfIE7dgmax+yMP2WgMd2OecBuaATHKTHsLWHQeuaxMRnCsH8+5g==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.1.tgz", + "integrity": "sha512-X53z6uXip6KFXBQ+Krbx25XHV/NCbzryM6ehOAeAil7X7oa4XIq+394PWGnwaSQ2WRA0KI6PUO6hTO5zeF5ijA==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.1.tgz", + "integrity": "sha512-Na9T3szbXezdzM/Kfs3GcRQNjHzM6GzFBeU1/6IV/npKP5ORtp9zbQjvkDJ47s6BCgaAZnnnu/cY1x342+MvZg==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.1.tgz", + "integrity": "sha512-T3H78X2h1tszfRSf+txbt5aOp/e7TAz3ptVKu9Oyir3IAOFPGV6O9c2naym5TOriy1l0nNf6a4X5UXRZSGX/dw==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.1.tgz", + "integrity": "sha512-2H3RUvcmULO7dIE5EWJH8eubZAI4xw54H1ilJnRNZdeo8dTADEZ21w6J22XBkXqGJbe0+wnNJtw3UXRoLJnFEg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.1.tgz", + "integrity": "sha512-GE7XvrdOzrb+yVKB9KsRMq+7a2U/K5Cf/8grVFRAGJmfADr/e/ODQ134RK2/eeHqYV5eQRFxb1hY7Nr15fv1NQ==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.1.tgz", + "integrity": "sha512-uOxSJCIcavSiT6UnBhBzE8wy3n0hOkJsBOzy7HDAuTDE++1DJMRRVCPGisULScHL+a/ZwdXPpXD3IyFKjA7K8A==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.1.tgz", + "integrity": "sha512-Y1EQdcfwMSeQN/ujR5VayLOJ1BHaK+ssyk0AEzPjC+t1lITgsnccPqFjb6V+LsTp/9Iov4ysfjxLaGJ9RPtkVg==", + "dev": true, + "optional": true + }, + "@eslint-community/eslint-utils": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", + "integrity": "sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^3.4.3" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true + } + } + }, + "@eslint-community/regexpp": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "dev": true + }, + "@eslint/config-array": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz", + "integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==", + "dev": true, + "requires": { + "@eslint/object-schema": "^2.1.6", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "@eslint/core": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.11.0.tgz", + "integrity": "sha512-DWUB2pksgNEb6Bz2fggIy1wh6fGgZP4Xyy/Mt0QZPiloKKXerbqq9D3SBQTlCRYOrcRPu4vuz+CGjwdfqxnoWA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.15" + } + }, + "@eslint/eslintrc": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz", + "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "@eslint/js": { + "version": "9.20.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.20.0.tgz", + "integrity": "sha512-iZA07H9io9Wn836aVTytRaNqh00Sad+EamwOVJT12GTLw1VGMFV/4JaME+JjLtr9fiGaoWgYnS54wrfWsSs4oQ==", + "dev": true + }, + "@eslint/object-schema": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", + "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", + "dev": true + }, + "@eslint/plugin-kit": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.5.tgz", + "integrity": "sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==", + "dev": true, + "requires": { + "@eslint/core": "^0.10.0", + "levn": "^0.4.1" + }, + "dependencies": { + "@eslint/core": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.10.0.tgz", + "integrity": "sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.15" + } + } + } + }, + "@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", + "dev": true + }, + "@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, + "requires": { + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" + }, + "dependencies": { + "@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true + } + } + }, + "@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true + }, + "@humanwhocodes/retry": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz", + "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==", + "dev": true + }, + "@img/sharp-darwin-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", + "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-darwin-arm64": "1.0.4" + } + }, + "@img/sharp-darwin-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", + "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-darwin-x64": "1.0.4" + } + }, + "@img/sharp-libvips-darwin-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", + "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-darwin-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", + "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linux-arm": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", + "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linux-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", + "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linux-s390x": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", + "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linux-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", + "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", + "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", + "dev": true, + "optional": true + }, + "@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", + "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", + "dev": true, + "optional": true + }, + "@img/sharp-linux-arm": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", + "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linux-arm": "1.0.5" + } + }, + "@img/sharp-linux-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", + "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linux-arm64": "1.0.4" + } + }, + "@img/sharp-linux-s390x": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", + "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linux-s390x": "1.0.4" + } + }, + "@img/sharp-linux-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", + "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linux-x64": "1.0.4" + } + }, + "@img/sharp-linuxmusl-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", + "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" + } + }, + "@img/sharp-linuxmusl-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", + "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.4" + } + }, + "@img/sharp-wasm32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", + "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", + "dev": true, + "optional": true, + "requires": { + "@emnapi/runtime": "^1.2.0" + } + }, + "@img/sharp-win32-ia32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", + "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", + "dev": true, + "optional": true + }, + "@img/sharp-win32-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", + "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", + "dev": true, + "optional": true + }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } + } + }, + "@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true + }, + "@jdeniau/immutable-devtools": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@jdeniau/immutable-devtools/-/immutable-devtools-0.2.0.tgz", + "integrity": "sha512-kncZLhyszWkGz0wAr8eoHFvhczuZz5Ud71OiLIhe5PFQ05nnLgsFdr520Qy+eHhMSL6roJYFrZ73ZJTv48/fUg==", + "dev": true + }, + "@jest/console": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.6.4.tgz", + "integrity": "sha512-wNK6gC0Ha9QeEPSkeJedQuTQqxZYnDPuDcDhVuVatRvMkL4D0VTvFVZj+Yuh6caG2aOfzkUZ36KtCmLNtR02hw==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.6.3", + "jest-util": "^29.6.3", + "slash": "^3.0.0" + } + }, + "@jest/core": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.6.4.tgz", + "integrity": "sha512-U/vq5ccNTSVgYH7mHnodHmCffGWHJnz/E1BEWlLuK5pM4FZmGfBn/nrJGLjUsSmyx3otCeqc1T31F4y08AMDLg==", + "dev": true, + "requires": { + "@jest/console": "^29.6.4", + "@jest/reporters": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.6.3", + "jest-config": "^29.6.4", + "jest-haste-map": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-resolve-dependencies": "^29.6.4", + "jest-runner": "^29.6.4", + "jest-runtime": "^29.6.4", + "jest-snapshot": "^29.6.4", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "jest-watcher": "^29.6.4", + "micromatch": "^4.0.4", + "pretty-format": "^29.6.3", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "@jest/environment": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "dev": true, + "requires": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + } + }, + "@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "requires": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + } + }, + "@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "requires": { + "jest-get-type": "^29.6.3" + } + }, + "@jest/fake-timers": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + } + }, + "@jest/globals": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, + "requires": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + } + }, + "@jest/reporters": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.6.4.tgz", + "integrity": "sha512-sxUjWxm7QdchdrD3NfWKrL8FBsortZeibSJv4XLjESOOjSUOkjQcb0ZHJwfhEGIvBvTluTzfG2yZWZhkrXJu8g==", + "dev": true, + "requires": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.6.3", + "jest-util": "^29.6.3", + "jest-worker": "^29.6.4", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "dependencies": { + "istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "requires": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + } + }, + "semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true + } + } + }, + "@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "requires": { + "@sinclair/typebox": "^0.27.8" + } + }, + "@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + } + }, + "@jest/test-result": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.6.4.tgz", + "integrity": "sha512-uQ1C0AUEN90/dsyEirgMLlouROgSY+Wc/JanVVk0OiUKa5UFh7sJpMEM3aoUBAz2BRNvUJ8j3d294WFuRxSyOQ==", + "dev": true, + "requires": { + "@jest/console": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + } + }, + "@jest/test-sequencer": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.6.4.tgz", + "integrity": "sha512-E84M6LbpcRq3fT4ckfKs9ryVanwkaIB0Ws9bw3/yP4seRLg/VaCZ/LgW0MCq5wwk4/iP/qnilD41aj2fsw2RMg==", + "dev": true, + "requires": { + "@jest/test-result": "^29.6.4", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "slash": "^3.0.0" + } + }, + "@jest/transform": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "dev": true, + "requires": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "dependencies": { + "convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + } + } + }, + "@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, + "requires": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + } + }, + "@jridgewell/gen-mapping": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", + "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", + "dev": true + }, + "@jridgewell/source-map": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", + "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "dev": true, + "requires": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "@lezer/common": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.3.tgz", + "integrity": "sha512-w7ojc8ejBqr2REPsWxJjrMFsA/ysDCFICn8zEOR9mrqzOu2amhITYuLD8ag6XZf0CFXDrhKqw7+tW8cX66NaDA==", + "dev": true + }, + "@lezer/highlight": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.1.tgz", + "integrity": "sha512-Z5duk4RN/3zuVO7Jq0pGLJ3qynpxUVsh7IbUbGj88+uV2ApSAn6kWg2au3iJb+0Zi7kKtqffIESgNcRXWZWmSA==", + "dev": true, + "requires": { + "@lezer/common": "^1.0.0" + } + }, + "@lezer/javascript": { + "version": "1.4.21", + "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.21.tgz", + "integrity": "sha512-lL+1fcuxWYPURMM/oFZLEDm0XuLN128QPV+VuGtKpeaOGdcl9F2LYC3nh1S9LkPqx9M0mndZFdXCipNAZpzIkQ==", + "dev": true, + "requires": { + "@lezer/common": "^1.2.0", + "@lezer/highlight": "^1.1.3", + "@lezer/lr": "^1.3.0" + } + }, + "@lezer/lr": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.2.tgz", + "integrity": "sha512-pu0K1jCIdnQ12aWNaAVU5bzi7Bd1w54J3ECgANPmYLtQKP0HBj2cE/5coBD66MT10xbtIuUr7tg0Shbsvk0mDA==", + "dev": true, + "requires": { + "@lezer/common": "^1.0.0" + } + }, + "@marijn/find-cluster-break": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@marijn/find-cluster-break/-/find-cluster-break-1.0.2.tgz", + "integrity": "sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g==", + "dev": true + }, + "@next/env": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/env/-/env-15.2.4.tgz", + "integrity": "sha512-+SFtMgoiYP3WoSswuNmxJOCwi06TdWE733D+WPjpXIe4LXGULwEaofiiAy6kbS0+XjM5xF5n3lKuBwN2SnqD9g==", + "dev": true + }, + "@next/swc-darwin-arm64": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.2.4.tgz", + "integrity": "sha512-1AnMfs655ipJEDC/FHkSr0r3lXBgpqKo4K1kiwfUf3iE68rDFXZ1TtHdMvf7D0hMItgDZ7Vuq3JgNMbt/+3bYw==", + "dev": true, + "optional": true + }, + "@next/swc-darwin-x64": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.2.4.tgz", + "integrity": "sha512-3qK2zb5EwCwxnO2HeO+TRqCubeI/NgCe+kL5dTJlPldV/uwCnUgC7VbEzgmxbfrkbjehL4H9BPztWOEtsoMwew==", + "dev": true, + "optional": true + }, + "@next/swc-linux-arm64-gnu": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.2.4.tgz", + "integrity": "sha512-HFN6GKUcrTWvem8AZN7tT95zPb0GUGv9v0d0iyuTb303vbXkkbHDp/DxufB04jNVD+IN9yHy7y/6Mqq0h0YVaQ==", + "dev": true, + "optional": true + }, + "@next/swc-linux-arm64-musl": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.2.4.tgz", + "integrity": "sha512-Oioa0SORWLwi35/kVB8aCk5Uq+5/ZIumMK1kJV+jSdazFm2NzPDztsefzdmzzpx5oGCJ6FkUC7vkaUseNTStNA==", + "dev": true, + "optional": true + }, + "@next/swc-linux-x64-gnu": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.2.4.tgz", + "integrity": "sha512-yb5WTRaHdkgOqFOZiu6rHV1fAEK0flVpaIN2HB6kxHVSy/dIajWbThS7qON3W9/SNOH2JWkVCyulgGYekMePuw==", + "dev": true, + "optional": true + }, + "@next/swc-linux-x64-musl": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.2.4.tgz", + "integrity": "sha512-Dcdv/ix6srhkM25fgXiyOieFUkz+fOYkHlydWCtB0xMST6X9XYI3yPDKBZt1xuhOytONsIFJFB08xXYsxUwJLw==", + "dev": true, + "optional": true + }, + "@next/swc-win32-arm64-msvc": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.2.4.tgz", + "integrity": "sha512-dW0i7eukvDxtIhCYkMrZNQfNicPDExt2jPb9AZPpL7cfyUo7QSNl1DjsHjmmKp6qNAqUESyT8YFl/Aw91cNJJg==", + "dev": true, + "optional": true + }, + "@next/swc-win32-x64-msvc": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.2.4.tgz", + "integrity": "sha512-SbnWkJmkS7Xl3kre8SdMF6F/XDh1DTFEhp0jRTj/uB8iPKoU2bb2NDfcu+iifv1+mxQEd1g2vvSxcZbXSKyWiQ==", + "dev": true, + "optional": true + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@nolyfill/is-core-module": { + "version": "1.0.39", + "resolved": "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz", + "integrity": "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==", + "dev": true + }, + "@rollup/plugin-buble": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@rollup/plugin-buble/-/plugin-buble-1.0.3.tgz", + "integrity": "sha512-QYD9BKkJoof0FdCFeSYYhF6/Y8e0Mnf+098xGgmWOFJ4UPHlWujjqOYeVwEm2hJPOmlR5k7HPUdAjqtOWhN64Q==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^5.0.1", + "@types/buble": "^0.19.2", + "buble": "^0.20.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "buble": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/buble/-/buble-0.20.0.tgz", + "integrity": "sha512-/1gnaMQE8xvd5qsNBl+iTuyjJ9XxeaVxAMF86dQ4EyxFJOZtsgOS8Ra+7WHgZTam5IFDtt4BguN0sH0tVTKrOw==", + "dev": true, + "requires": { + "acorn": "^6.4.1", + "acorn-dynamic-import": "^4.0.0", + "acorn-jsx": "^5.2.0", + "chalk": "^2.4.2", + "magic-string": "^0.25.7", + "minimist": "^1.2.5", + "regexpu-core": "4.5.4" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "regexpu-core": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", + "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", + "dev": true, + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.0.2", + "regjsgen": "^0.5.0", + "regjsparser": "^0.6.0", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.1.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@rollup/plugin-commonjs": { + "version": "28.0.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-28.0.2.tgz", + "integrity": "sha512-BEFI2EDqzl+vA1rl97IDRZ61AIwGH093d9nz8+dThxJNH8oSoB7MjWvPCX3dkaK1/RCJ/1v/R1XB15FuSs0fQw==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^5.0.1", + "commondir": "^1.0.1", + "estree-walker": "^2.0.2", + "fdir": "^6.2.0", + "is-reference": "1.2.1", + "magic-string": "^0.30.3", + "picomatch": "^4.0.2" + }, + "dependencies": { + "fdir": { + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", + "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "dev": true, + "requires": {} + }, + "magic-string": { + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "dev": true, + "requires": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true + } + } + }, + "@rollup/plugin-json": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-6.1.0.tgz", + "integrity": "sha512-EGI2te5ENk1coGeADSIwZ7G2Q8CJS2sF120T7jLw4xFw9n7wIOXHo+kIYRAoVpJAN+kmqZSoO3Fp4JtoNF4ReA==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^5.1.0" + } + }, + "@rollup/plugin-terser": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz", + "integrity": "sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==", + "dev": true, + "requires": { + "serialize-javascript": "^6.0.1", + "smob": "^1.0.0", + "terser": "^5.17.4" + } + }, + "@rollup/plugin-typescript": { + "version": "12.1.2", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-12.1.2.tgz", + "integrity": "sha512-cdtSp154H5sv637uMr1a8OTWB0L1SWDSm1rDGiyfcGcvQ6cuTs4MDk2BVEBGysUWago4OJN4EQZqOTl/QY3Jgg==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^5.1.0", + "resolve": "^1.22.1" + } + }, + "@rollup/pluginutils": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.4.tgz", + "integrity": "sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==", + "dev": true, + "requires": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "dependencies": { + "picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true + } + } + }, + "@rollup/rollup-android-arm-eabi": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.34.8.tgz", + "integrity": "sha512-q217OSE8DTp8AFHuNHXo0Y86e1wtlfVrXiAlwkIvGRQv9zbc6mE3sjIVfwI8sYUyNxwOg0j/Vm1RKM04JcWLJw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-android-arm64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.34.8.tgz", + "integrity": "sha512-Gigjz7mNWaOL9wCggvoK3jEIUUbGul656opstjaUSGC3eT0BM7PofdAJaBfPFWWkXNVAXbaQtC99OCg4sJv70Q==", + "dev": true, + "optional": true + }, + "@rollup/rollup-darwin-arm64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.34.8.tgz", + "integrity": "sha512-02rVdZ5tgdUNRxIUrFdcMBZQoaPMrxtwSb+/hOfBdqkatYHR3lZ2A2EGyHq2sGOd0Owk80oV3snlDASC24He3Q==", + "dev": true, + "optional": true + }, + "@rollup/rollup-darwin-x64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.34.8.tgz", + "integrity": "sha512-qIP/elwR/tq/dYRx3lgwK31jkZvMiD6qUtOycLhTzCvrjbZ3LjQnEM9rNhSGpbLXVJYQ3rq39A6Re0h9tU2ynw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-freebsd-arm64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.34.8.tgz", + "integrity": "sha512-IQNVXL9iY6NniYbTaOKdrlVP3XIqazBgJOVkddzJlqnCpRi/yAeSOa8PLcECFSQochzqApIOE1GHNu3pCz+BDA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-freebsd-x64": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.34.8.tgz", + "integrity": "sha512-TYXcHghgnCqYFiE3FT5QwXtOZqDj5GmaFNTNt3jNC+vh22dc/ukG2cG+pi75QO4kACohZzidsq7yKTKwq/Jq7Q==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.34.8.tgz", + "integrity": "sha512-A4iphFGNkWRd+5m3VIGuqHnG3MVnqKe7Al57u9mwgbyZ2/xF9Jio72MaY7xxh+Y87VAHmGQr73qoKL9HPbXj1g==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm-musleabihf": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.34.8.tgz", + "integrity": "sha512-S0lqKLfTm5u+QTxlFiAnb2J/2dgQqRy/XvziPtDd1rKZFXHTyYLoVL58M/XFwDI01AQCDIevGLbQrMAtdyanpA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm64-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.34.8.tgz", + "integrity": "sha512-jpz9YOuPiSkL4G4pqKrus0pn9aYwpImGkosRKwNi+sJSkz+WU3anZe6hi73StLOQdfXYXC7hUfsQlTnjMd3s1A==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-arm64-musl": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.34.8.tgz", + "integrity": "sha512-KdSfaROOUJXgTVxJNAZ3KwkRc5nggDk+06P6lgi1HLv1hskgvxHUKZ4xtwHkVYJ1Rep4GNo+uEfycCRRxht7+Q==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.34.8.tgz", + "integrity": "sha512-NyF4gcxwkMFRjgXBM6g2lkT58OWztZvw5KkV2K0qqSnUEqCVcqdh2jN4gQrTn/YUpAcNKyFHfoOZEer9nwo6uQ==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.34.8.tgz", + "integrity": "sha512-LMJc999GkhGvktHU85zNTDImZVUCJ1z/MbAJTnviiWmmjyckP5aQsHtcujMjpNdMZPT2rQEDBlJfubhs3jsMfw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-riscv64-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.34.8.tgz", + "integrity": "sha512-xAQCAHPj8nJq1PI3z8CIZzXuXCstquz7cIOL73HHdXiRcKk8Ywwqtx2wrIy23EcTn4aZ2fLJNBB8d0tQENPCmw==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-s390x-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.34.8.tgz", + "integrity": "sha512-DdePVk1NDEuc3fOe3dPPTb+rjMtuFw89gw6gVWxQFAuEqqSdDKnrwzZHrUYdac7A7dXl9Q2Vflxpme15gUWQFA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-x64-gnu": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.34.8.tgz", + "integrity": "sha512-8y7ED8gjxITUltTUEJLQdgpbPh1sUQ0kMTmufRF/Ns5tI9TNMNlhWtmPKKHCU0SilX+3MJkZ0zERYYGIVBYHIA==", + "dev": true, + "optional": true + }, + "@rollup/rollup-linux-x64-musl": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.34.8.tgz", + "integrity": "sha512-SCXcP0ZpGFIe7Ge+McxY5zKxiEI5ra+GT3QRxL0pMMtxPfpyLAKleZODi1zdRHkz5/BhueUrYtYVgubqe9JBNQ==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-arm64-msvc": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.34.8.tgz", + "integrity": "sha512-YHYsgzZgFJzTRbth4h7Or0m5O74Yda+hLin0irAIobkLQFRQd1qWmnoVfwmKm9TXIZVAD0nZ+GEb2ICicLyCnQ==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-ia32-msvc": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.34.8.tgz", + "integrity": "sha512-r3NRQrXkHr4uWy5TOjTpTYojR9XmF0j/RYgKCef+Ag46FWUTltm5ziticv8LdNsDMehjJ543x/+TJAek/xBA2w==", + "dev": true, + "optional": true + }, + "@rollup/rollup-win32-x64-msvc": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.34.8.tgz", + "integrity": "sha512-U0FaE5O1BCpZSeE6gBl3c5ObhePQSfk9vDRToMmTkbhCOgW4jqvtS5LGyQ76L1fH8sM0keRp4uDTsbjiUyjk0g==", + "dev": true, + "optional": true + }, + "@rtsao/scc": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", + "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", + "dev": true + }, + "@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, + "@sinonjs/commons": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, + "requires": { + "@sinonjs/commons": "^3.0.0" + } + }, + "@size-limit/esbuild-why": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@size-limit/esbuild-why/-/esbuild-why-11.2.0.tgz", + "integrity": "sha512-VtoQbbkvFbF314LWEaEp1+IjG0DH+9w6nP//D6Gd48SEAPLoBgqk287mjYTF9WYxg9N5lo8KjpXxEFk4gOXNpw==", + "dev": true, + "requires": { + "esbuild-visualizer": "^0.7.0", + "open": "^10.1.0" + } + }, + "@size-limit/preset-small-lib": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@size-limit/preset-small-lib/-/preset-small-lib-11.2.0.tgz", + "integrity": "sha512-RFbbIVfv8/QDgTPyXzjo5NKO6CYyK5Uq5xtNLHLbw5RgSKrgo8WpiB/fNivZuNd/5Wk0s91PtaJ9ThNcnFuI3g==", + "dev": true, + "requires": { + "@size-limit/esbuild": "11.2.0", + "@size-limit/file": "11.2.0", + "size-limit": "11.2.0" + }, + "dependencies": { + "@size-limit/esbuild": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@size-limit/esbuild/-/esbuild-11.2.0.tgz", + "integrity": "sha512-vSg9H0WxGQPRzDnBzeDyD9XT0Zdq0L+AI3+77/JhxznbSCMJMMr8ndaWVQRhOsixl97N0oD4pRFw2+R1Lcvi6A==", + "dev": true, + "requires": { + "esbuild": "^0.25.0", + "nanoid": "^5.1.0" + } + }, + "@size-limit/file": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@size-limit/file/-/file-11.2.0.tgz", + "integrity": "sha512-OZHE3putEkQ/fgzz3Tp/0hSmfVo3wyTpOJSRNm6AmcwX4Nm9YtTfbQQ/hZRwbBFR23S7x2Sd9EbqYzngKwbRoA==", + "dev": true, + "requires": {} + }, + "nanoid": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.4.tgz", + "integrity": "sha512-GTFcMIDgR7tqji/LpSY8rtg464VnJl/j6ypoehYnuGb+Y8qZUdtKB8WVCXon0UEZgFDbuUxpIl//6FHLHgXSNA==", + "dev": true + } + } + }, + "@swc/counter": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", + "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==", + "dev": true + }, + "@swc/helpers": { + "version": "0.5.15", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", + "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==", + "dev": true, + "requires": { + "tslib": "^2.8.0" + } + }, + "@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "dev": true + }, + "@tsconfig/node10": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", + "dev": true + }, + "@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, + "@types/babel__core": { + "version": "7.20.1", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.1.tgz", + "integrity": "sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw==", + "dev": true, + "requires": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "@types/babel__generator": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", + "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@types/babel__template": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", + "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@types/babel__traverse": { + "version": "7.20.1", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.1.tgz", + "integrity": "sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg==", + "dev": true, + "requires": { + "@babel/types": "^7.20.7" + } + }, + "@types/buble": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@types/buble/-/buble-0.19.2.tgz", + "integrity": "sha512-uUD8zIfXMKThmFkahTXDGI3CthFH1kMg2dOm3KLi4GlC5cbARA64bEcUMbbWdWdE73eoc/iBB9PiTMqH0dNS2Q==", + "dev": true, + "requires": { + "magic-string": "^0.25.0" + } + }, + "@types/estree": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "dev": true + }, + "@types/gensync": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/gensync/-/gensync-1.0.4.tgz", + "integrity": "sha512-C3YYeRQWp2fmq9OryX+FoDy8nXS6scQ7dPptD8LnFDAUNcKWJjXQKDNJD3HVm+kOUsXhTOkpi69vI4EuAr95bA==", + "dev": true + }, + "@types/graceful-fs": { + "version": "4.1.6", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz", + "integrity": "sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, + "@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*" + } + }, + "@types/istanbul-reports": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "dev": true, + "requires": { + "@types/istanbul-lib-report": "*" + } + }, + "@types/jsdom": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@types/jsdom/-/jsdom-20.0.1.tgz", + "integrity": "sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==", + "dev": true, + "requires": { + "@types/node": "*", + "@types/tough-cookie": "*", + "parse5": "^7.0.0" + } + }, + "@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true + }, + "@types/node": { + "version": "14.17.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.3.tgz", + "integrity": "sha512-e6ZowgGJmTuXa3GyaPbTGxX17tnThl2aSSizrFthQ7m9uLGZBXiGhgE55cjRZTF5kjZvYn9EOPOMljdjwbflxw==", + "dev": true + }, + "@types/prismjs": { + "version": "1.26.3", + "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.3.tgz", + "integrity": "sha512-A0D0aTXvjlqJ5ZILMz3rNfDBOx9hHxLZYv2by47Sm/pqW35zzjusrZTryatjN/Rf8Us2gZrJD+KeHbUSTux1Cw==", + "dev": true + }, + "@types/random-seed": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@types/random-seed/-/random-seed-0.3.5.tgz", + "integrity": "sha512-CftxcDPAHgs0SLHU2dt+ZlDPJfGqLW3sZlC/ATr5vJDSe5tRLeOne7HMvCOJnFyF8e1U41wqzs3h6AMC613xtA==", + "dev": true + }, + "@types/react": { + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.0.tgz", + "integrity": "sha512-UaicktuQI+9UKyA4njtDOGBD/67t8YEBt2xdfqu8+gP9hqPUPsiXlNPcpS2gVdjmis5GKPG3fCxbQLVgxsQZ8w==", + "dev": true, + "requires": { + "csstype": "^3.0.2" + } + }, + "@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "@types/tough-cookie": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-4.0.2.tgz", + "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==", + "dev": true + }, + "@types/yargs": { + "version": "17.0.24", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", + "integrity": "sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "@types/yargs-parser": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", + "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", + "dev": true + }, + "@typescript-eslint/eslint-plugin": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.24.0.tgz", + "integrity": "sha512-aFcXEJJCI4gUdXgoo/j9udUYIHgF23MFkg09LFz2dzEmU0+1Plk4rQWv/IYKvPHAtlkkGoB3m5e6oUp+JPsNaQ==", + "dev": true, + "requires": { + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.24.0", + "@typescript-eslint/type-utils": "8.24.0", + "@typescript-eslint/utils": "8.24.0", + "@typescript-eslint/visitor-keys": "8.24.0", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.0.1" + } + }, + "@typescript-eslint/parser": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.24.0.tgz", + "integrity": "sha512-MFDaO9CYiard9j9VepMNa9MTcqVvSny2N4hkY6roquzj8pdCBRENhErrteaQuu7Yjn1ppk0v1/ZF9CG3KIlrTA==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "8.24.0", + "@typescript-eslint/types": "8.24.0", + "@typescript-eslint/typescript-estree": "8.24.0", + "@typescript-eslint/visitor-keys": "8.24.0", + "debug": "^4.3.4" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "@typescript-eslint/scope-manager": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.24.0.tgz", + "integrity": "sha512-HZIX0UByphEtdVBKaQBgTDdn9z16l4aTUz8e8zPQnyxwHBtf5vtl1L+OhH+m1FGV9DrRmoDuYKqzVrvWDcDozw==", + "dev": true, + "requires": { + "@typescript-eslint/types": "8.24.0", + "@typescript-eslint/visitor-keys": "8.24.0" + } + }, + "@typescript-eslint/type-utils": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.24.0.tgz", + "integrity": "sha512-8fitJudrnY8aq0F1wMiPM1UUgiXQRJ5i8tFjq9kGfRajU+dbPyOuHbl0qRopLEidy0MwqgTHDt6CnSeXanNIwA==", + "dev": true, + "requires": { + "@typescript-eslint/typescript-estree": "8.24.0", + "@typescript-eslint/utils": "8.24.0", + "debug": "^4.3.4", + "ts-api-utils": "^2.0.1" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "@typescript-eslint/types": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.24.0.tgz", + "integrity": "sha512-VacJCBTyje7HGAw7xp11q439A+zeGG0p0/p2zsZwpnMzjPB5WteaWqt4g2iysgGFafrqvyLWqq6ZPZAOCoefCw==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.24.0.tgz", + "integrity": "sha512-ITjYcP0+8kbsvT9bysygfIfb+hBj6koDsu37JZG7xrCiy3fPJyNmfVtaGsgTUSEuTzcvME5YI5uyL5LD1EV5ZQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "8.24.0", + "@typescript-eslint/visitor-keys": "8.24.0", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.0.1" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true + } + } + }, + "@typescript-eslint/utils": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.24.0.tgz", + "integrity": "sha512-07rLuUBElvvEb1ICnafYWr4hk8/U7X9RDCOqd9JcAMtjh/9oRmcfN4yGzbPVirgMR0+HLVHehmu19CWeh7fsmQ==", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.24.0", + "@typescript-eslint/types": "8.24.0", + "@typescript-eslint/typescript-estree": "8.24.0" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.24.0.tgz", + "integrity": "sha512-kArLq83QxGLbuHrTMoOEWO+l2MwsNS2TGISEdx8xgqpkbytB07XmlQyQdNDrCc1ecSqx0cnmhGvpX+VBwqqSkg==", + "dev": true, + "requires": { + "@typescript-eslint/types": "8.24.0", + "eslint-visitor-keys": "^4.2.0" + } + }, + "abab": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", + "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", + "dev": true + }, + "acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "dev": true + }, + "acorn-dynamic-import": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", + "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", + "dev": true, + "requires": {} + }, + "acorn-globals": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-7.0.1.tgz", + "integrity": "sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==", + "dev": true, + "requires": { + "acorn": "^8.1.0", + "acorn-walk": "^8.0.2" + }, + "dependencies": { + "acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true + } + } + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "requires": {} + }, + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "dev": true + }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "requires": { + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "aggregate-error": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-4.0.1.tgz", + "integrity": "sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w==", + "dev": true, + "requires": { + "clean-stack": "^4.0.0", + "indent-string": "^5.0.0" + } + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "requires": { + "type-fest": "^0.21.3" + }, + "dependencies": { + "type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true + } + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "array-buffer-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz", + "integrity": "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "is-array-buffer": "^3.0.5" + } + }, + "array-includes": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", + "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.4", + "is-string": "^1.0.7" + } + }, + "array.prototype.findlast": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", + "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + } + }, + "array.prototype.findlastindex": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", + "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + } + }, + "array.prototype.flat": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", + "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + } + }, + "array.prototype.flatmap": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", + "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + } + }, + "array.prototype.tosorted": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz", + "integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3", + "es-errors": "^1.3.0", + "es-shim-unscopables": "^1.0.2" + } + }, + "arraybuffer.prototype.slice": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", + "integrity": "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.1", + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "is-array-buffer": "^3.0.4" + } + }, + "arrify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-3.0.0.tgz", + "integrity": "sha512-tLkvA81vQG/XqE2mjDkGQHoOINtMHtysSnemrmoGe6PydDPMRbVugqyk4A6V/WDWEfm3l+0d8anA9r8cv/5Jaw==", + "dev": true + }, + "async-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async-function/-/async-function-1.0.0.tgz", + "integrity": "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "available-typed-arrays": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", + "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "dev": true, + "requires": { + "possible-typed-array-names": "^1.0.0" + } + }, + "babel-jest": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.6.4.tgz", + "integrity": "sha512-meLj23UlSLddj6PC+YTOFRgDAtjnZom8w/ACsrx0gtPtv5cJZk0A5Unk5bV4wixD7XaPCN1fQvpww8czkZURmw==", + "dev": true, + "requires": { + "@jest/transform": "^29.6.4", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + } + }, + "babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + } + }, + "babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "dev": true, + "requires": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + } + }, + "babel-preset-current-node-syntax": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "dev": true, + "requires": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" + } + }, + "babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, + "requires": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "benchmark": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", + "integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=", + "dev": true, + "requires": { + "lodash": "^4.17.4", + "platform": "^1.3.3" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "requires": { + "fill-range": "^7.1.1" + } + }, + "browserslist": { + "version": "4.24.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz", + "integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001688", + "electron-to-chromium": "^1.5.73", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.1" + } + }, + "bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "requires": { + "node-int64": "^0.4.0" + } + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "bundle-name": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz", + "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==", + "dev": true, + "requires": { + "run-applescript": "^7.0.0" + } + }, + "busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dev": true, + "requires": { + "streamsearch": "^1.1.0" + } + }, + "bytes-iec": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/bytes-iec/-/bytes-iec-3.1.1.tgz", + "integrity": "sha512-fey6+4jDK7TFtFg/klGSvNKJctyU7n2aQdnM+CO0ruLPbqqMOM8Tio0Pc+deqUeVKX1tL5DQep1zQ7+37aTAsA==", + "dev": true + }, + "call-bind": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz", + "integrity": "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.0", + "es-define-property": "^1.0.0", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.2" + } + }, + "call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + } + }, + "call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30001699", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001699.tgz", + "integrity": "sha512-b+uH5BakXZ9Do9iK+CkDmctUSEqZl+SP056vc5usa0PL+ev5OHw003rZXcnjNDv3L8P5j6rwT6C0BPKSikW08w==", + "dev": true + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true + }, + "chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "requires": { + "readdirp": "^4.0.1" + } + }, + "ci-info": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", + "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", + "dev": true + }, + "cjs-module-lexer": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", + "dev": true + }, + "clean-stack": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-4.2.0.tgz", + "integrity": "sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg==", + "dev": true, + "requires": { + "escape-string-regexp": "5.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "dev": true + } + } + }, + "client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", + "dev": true + }, + "cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "dependencies": { + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + } + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true + }, + "codemirror": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.1.tgz", + "integrity": "sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==", + "dev": true, + "requires": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/commands": "^6.0.0", + "@codemirror/language": "^6.0.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/search": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0" + } + }, + "collect-v8-coverage": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", + "dev": true + }, + "color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "dev": true, + "optional": true, + "requires": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dev": true, + "optional": true, + "requires": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "dev": true + }, + "cp-file": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-10.0.0.tgz", + "integrity": "sha512-vy2Vi1r2epK5WqxOLnskeKeZkdZvTKfFZQCplE3XWsP+SUJyd5XAUFC9lFgTjjXJF2GMne/UML14iEmkAaDfFg==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.10", + "nested-error-stacks": "^2.1.1", + "p-event": "^5.0.1" + } + }, + "cpy": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/cpy/-/cpy-10.1.0.tgz", + "integrity": "sha512-VC2Gs20JcTyeQob6UViBLnyP0bYHkBh6EiKzot9vi2DmeGlFT9Wd7VG3NBrkNx/jYvFBeyDOMMHdHQhbtKLgHQ==", + "dev": true, + "requires": { + "arrify": "^3.0.0", + "cp-file": "^10.0.0", + "globby": "^13.1.4", + "junk": "^4.0.1", + "micromatch": "^4.0.5", + "nested-error-stacks": "^2.1.1", + "p-filter": "^3.0.0", + "p-map": "^6.0.0" + }, + "dependencies": { + "globby": { + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.2.2.tgz", + "integrity": "sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==", + "dev": true, + "requires": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.3.0", + "ignore": "^5.2.4", + "merge2": "^1.4.1", + "slash": "^4.0.0" + } + }, + "slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "dev": true + } + } + }, + "cpy-cli": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cpy-cli/-/cpy-cli-5.0.0.tgz", + "integrity": "sha512-fb+DZYbL9KHc0BC4NYqGRrDIJZPXUmjjtqdw4XRRg8iV8dIfghUX/WiL+q4/B/KFTy3sK6jsbUhBaz0/Hxg7IQ==", + "dev": true, + "requires": { + "cpy": "^10.1.0", + "meow": "^12.0.1" + } + }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "crelt": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", + "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "crypto-random-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", + "dev": true + }, + "cssom": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", + "integrity": "sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==", + "dev": true + }, + "cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "dev": true, + "requires": { + "cssom": "~0.3.6" + }, + "dependencies": { + "cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "dev": true + } + } + }, + "csstype": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.0.8.tgz", + "integrity": "sha512-jXKhWqXPmlUeoQnF/EhTtTl4C9SnrxSH/jZUih3jmO6lBKr99rP3/+FmrMj4EFpOXzMtXHAZkd3x0E6h6Fgflw==", + "dev": true + }, + "data-urls": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-3.0.2.tgz", + "integrity": "sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==", + "dev": true, + "requires": { + "abab": "^2.0.6", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0" + } + }, + "data-view-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.2.tgz", + "integrity": "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + } + }, + "data-view-byte-length": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.2.tgz", + "integrity": "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.2" + } + }, + "data-view-byte-offset": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.1.tgz", + "integrity": "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-data-view": "^1.0.1" + } + }, + "decimal.js": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", + "dev": true + }, + "dedent": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "dev": true, + "requires": {} + }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true + }, + "default-browser": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.2.1.tgz", + "integrity": "sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==", + "dev": true, + "requires": { + "bundle-name": "^4.1.0", + "default-browser-id": "^5.0.0" + } + }, + "default-browser-id": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.0.tgz", + "integrity": "sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA==", + "dev": true + }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, + "define-lazy-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "dev": true + }, + "define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "dev": true, + "requires": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "dev": true, + "optional": true + }, + "detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + }, + "diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "domexception": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", + "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", + "dev": true, + "requires": { + "webidl-conversions": "^7.0.0" + } + }, + "dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + } + }, + "electron-to-chromium": { + "version": "1.5.97", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.97.tgz", + "integrity": "sha512-HKLtaH02augM7ZOdYRuO19rWDeY+QSJ1VxnXFa/XDFLf07HvM90pALIJFgrO+UVaajI3+aJMMpojoUTLZyQ7JQ==", + "dev": true + }, + "emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true + }, + "enhanced-resolve": { + "version": "5.18.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz", + "integrity": "sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + } + }, + "entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.23.9", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.9.tgz", + "integrity": "sha512-py07lI0wjxAC/DcfK1S6G7iANonniZwTISvdPzk9hzeH0IZIshbuuFxLIU96OyF89Yb9hiqWn8M/bY83KY5vzA==", + "dev": true, + "requires": { + "array-buffer-byte-length": "^1.0.2", + "arraybuffer.prototype.slice": "^1.0.4", + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "data-view-buffer": "^1.0.2", + "data-view-byte-length": "^1.0.2", + "data-view-byte-offset": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-set-tostringtag": "^2.1.0", + "es-to-primitive": "^1.3.0", + "function.prototype.name": "^1.1.8", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.0", + "get-symbol-description": "^1.1.0", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "internal-slot": "^1.1.0", + "is-array-buffer": "^3.0.5", + "is-callable": "^1.2.7", + "is-data-view": "^1.0.2", + "is-regex": "^1.2.1", + "is-shared-array-buffer": "^1.0.4", + "is-string": "^1.1.1", + "is-typed-array": "^1.1.15", + "is-weakref": "^1.1.0", + "math-intrinsics": "^1.1.0", + "object-inspect": "^1.13.3", + "object-keys": "^1.1.1", + "object.assign": "^4.1.7", + "own-keys": "^1.0.1", + "regexp.prototype.flags": "^1.5.3", + "safe-array-concat": "^1.1.3", + "safe-push-apply": "^1.0.0", + "safe-regex-test": "^1.1.0", + "set-proto": "^1.0.0", + "string.prototype.trim": "^1.2.10", + "string.prototype.trimend": "^1.0.9", + "string.prototype.trimstart": "^1.0.8", + "typed-array-buffer": "^1.0.3", + "typed-array-byte-length": "^1.0.3", + "typed-array-byte-offset": "^1.0.4", + "typed-array-length": "^1.0.7", + "unbox-primitive": "^1.1.0", + "which-typed-array": "^1.1.18" + } + }, + "es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true + }, + "es-iterator-helpers": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.2.1.tgz", + "integrity": "sha512-uDn+FE1yrDzyC0pCo961B2IHbdM8y/ACZsKD4dG6WqrjV53BADjwa7D+1aom2rsNVfLyDgU/eigvlJGJ08OQ4w==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.6", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "iterator.prototype": "^1.1.4", + "safe-array-concat": "^1.1.3" + } + }, + "es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "requires": { + "es-errors": "^1.3.0" + } + }, + "es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + } + }, + "es-shim-unscopables": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", + "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", + "dev": true, + "requires": { + "hasown": "^2.0.2" + } + }, + "es-to-primitive": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", + "integrity": "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==", + "dev": true, + "requires": { + "is-callable": "^1.2.7", + "is-date-object": "^1.0.5", + "is-symbol": "^1.0.4" + } + }, + "esbuild": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.1.tgz", + "integrity": "sha512-BGO5LtrGC7vxnqucAe/rmvKdJllfGaYWdyABvyMoXQlfYMb2bbRuReWR5tEGE//4LcNJj9XrkovTqNYRFZHAMQ==", + "dev": true, + "requires": { + "@esbuild/aix-ppc64": "0.25.1", + "@esbuild/android-arm": "0.25.1", + "@esbuild/android-arm64": "0.25.1", + "@esbuild/android-x64": "0.25.1", + "@esbuild/darwin-arm64": "0.25.1", + "@esbuild/darwin-x64": "0.25.1", + "@esbuild/freebsd-arm64": "0.25.1", + "@esbuild/freebsd-x64": "0.25.1", + "@esbuild/linux-arm": "0.25.1", + "@esbuild/linux-arm64": "0.25.1", + "@esbuild/linux-ia32": "0.25.1", + "@esbuild/linux-loong64": "0.25.1", + "@esbuild/linux-mips64el": "0.25.1", + "@esbuild/linux-ppc64": "0.25.1", + "@esbuild/linux-riscv64": "0.25.1", + "@esbuild/linux-s390x": "0.25.1", + "@esbuild/linux-x64": "0.25.1", + "@esbuild/netbsd-arm64": "0.25.1", + "@esbuild/netbsd-x64": "0.25.1", + "@esbuild/openbsd-arm64": "0.25.1", + "@esbuild/openbsd-x64": "0.25.1", + "@esbuild/sunos-x64": "0.25.1", + "@esbuild/win32-arm64": "0.25.1", + "@esbuild/win32-ia32": "0.25.1", + "@esbuild/win32-x64": "0.25.1" + } + }, + "esbuild-visualizer": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/esbuild-visualizer/-/esbuild-visualizer-0.7.0.tgz", + "integrity": "sha512-Vz22k+G2WT7GuCo7rbhaQwGbZ26lEhwzsctkEdQlu2SVrshoM4hzQeRpu/3DP596a9+9K2JyYsinuC6AC896Og==", + "dev": true, + "requires": { + "open": "^8.4.0", + "picomatch": "^4.0.0", + "yargs": "^17.6.2" + }, + "dependencies": { + "define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "dev": true + }, + "is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true + }, + "is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "requires": { + "is-docker": "^2.0.0" + } + }, + "open": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", + "dev": true, + "requires": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + } + }, + "picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true + } + } + }, + "escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "dev": true, + "requires": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2", + "source-map": "~0.6.1" + } + }, + "eslint": { + "version": "9.20.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.20.1.tgz", + "integrity": "sha512-m1mM33o6dBUjxl2qb6wv6nGNwCAsns1eKtaQ4l/NPHeTvhiUPbtdfMyktxN4B3fgHIgsYh1VT3V9txblpQHq+g==", + "dev": true, + "requires": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.19.0", + "@eslint/core": "^0.11.0", + "@eslint/eslintrc": "^3.2.0", + "@eslint/js": "9.20.0", + "@eslint/plugin-kit": "^0.2.5", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.1", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.2.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "requires": { + "is-glob": "^4.0.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "eslint-import-resolver-node": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", + "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", + "dev": true, + "requires": { + "debug": "^3.2.7", + "is-core-module": "^2.13.0", + "resolve": "^1.22.4" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "eslint-import-resolver-typescript": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.7.0.tgz", + "integrity": "sha512-Vrwyi8HHxY97K5ebydMtffsWAn1SCR9eol49eCd5fJS4O1WV7PaAjbcjmbfJJSMz/t4Mal212Uz/fQZrOB8mow==", + "dev": true, + "requires": { + "@nolyfill/is-core-module": "1.0.39", + "debug": "^4.3.7", + "enhanced-resolve": "^5.15.0", + "fast-glob": "^3.3.2", + "get-tsconfig": "^4.7.5", + "is-bun-module": "^1.0.2", + "is-glob": "^4.0.3", + "stable-hash": "^0.0.4" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "eslint-module-utils": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz", + "integrity": "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==", + "dev": true, + "requires": { + "debug": "^3.2.7" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "eslint-plugin-import": { + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.31.0.tgz", + "integrity": "sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==", + "dev": true, + "requires": { + "@rtsao/scc": "^1.1.0", + "array-includes": "^3.1.8", + "array.prototype.findlastindex": "^1.2.5", + "array.prototype.flat": "^1.3.2", + "array.prototype.flatmap": "^1.3.2", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.9", + "eslint-module-utils": "^2.12.0", + "hasown": "^2.0.2", + "is-core-module": "^2.15.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.fromentries": "^2.0.8", + "object.groupby": "^1.0.3", + "object.values": "^1.2.0", + "semver": "^6.3.1", + "string.prototype.trimend": "^1.0.8", + "tsconfig-paths": "^3.15.0" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "eslint-plugin-jest": { + "version": "28.11.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.11.0.tgz", + "integrity": "sha512-QAfipLcNCWLVocVbZW8GimKn5p5iiMcgGbRzz8z/P5q7xw+cNEpYqyzFMtIF/ZgF2HLOyy+dYBut+DoYolvqig==", + "dev": true, + "requires": { + "@typescript-eslint/utils": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "eslint-plugin-react": { + "version": "7.37.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.4.tgz", + "integrity": "sha512-BGP0jRmfYyvOyvMoRX/uoUeW+GqNj9y16bPQzqAHf3AYII/tDs+jMN0dBVkl88/OZwNGwrVFxE7riHsXVfy/LQ==", + "dev": true, + "requires": { + "array-includes": "^3.1.8", + "array.prototype.findlast": "^1.2.5", + "array.prototype.flatmap": "^1.3.3", + "array.prototype.tosorted": "^1.1.4", + "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.2.1", + "estraverse": "^5.3.0", + "hasown": "^2.0.2", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.8", + "object.fromentries": "^2.0.8", + "object.values": "^1.2.1", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.5", + "semver": "^6.3.1", + "string.prototype.matchall": "^4.0.12", + "string.prototype.repeat": "^1.0.0" + }, + "dependencies": { + "resolve": { + "version": "2.0.0-next.5", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "dev": true, + "requires": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + } + } + }, + "eslint-scope": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz", + "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + } + }, + "eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true + }, + "espree": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", + "dev": true, + "requires": { + "acorn": "^8.14.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.0" + }, + "dependencies": { + "acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + } + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, + "estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + } + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true + }, + "expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "dev": true, + "requires": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + } + }, + "fast-check": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-4.0.0.tgz", + "integrity": "sha512-aXLyLemZ7qhLNn2oq+YpjT2Xed21+i29WGAYuyrGbU4r8oinB3i4XR4e62O3NY6qmm5qHEDoc/7d+gMsri3AfA==", + "dev": true, + "requires": { + "pure-rand": "^7.0.0" + }, + "dependencies": { + "pure-rand": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-7.0.1.tgz", + "integrity": "sha512-oTUZM/NAZS8p7ANR3SHh30kXB+zK2r2BPcEn/awJIbOvq82WoMN4p62AWWp3Hhw50G0xMsw1mhIBLqHw64EcNQ==", + "dev": true + } + } + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "dev": true, + "requires": { + "bser": "2.1.1" + } + }, + "file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "requires": { + "flat-cache": "^4.0.0" + } + }, + "fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "requires": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + } + }, + "flatted": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.2.tgz", + "integrity": "sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA==", + "dev": true + }, + "flow-bin": { + "version": "0.160.0", + "resolved": "https://registry.npmjs.org/flow-bin/-/flow-bin-0.160.0.tgz", + "integrity": "sha512-hqb/1z7U9Jv+2hDdslAgdab6D4AUDrYIcF2zH/CKx9YgQtCeHfnzCcypzCNU7xmBm2+Mi9+1hqeB4OQX2adh0A==", + "dev": true + }, + "for-each": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, + "requires": { + "is-callable": "^1.1.3" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true + }, + "function.prototype.name": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.8.tgz", + "integrity": "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "functions-have-names": "^1.2.3", + "hasown": "^2.0.2", + "is-callable": "^1.2.7" + } + }, + "functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true + }, + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-intrinsic": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", + "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", + "dev": true, + "requires": { + "call-bind-apply-helpers": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "function-bind": "^1.1.2", + "get-proto": "^1.0.0", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + } + }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, + "get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "requires": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + } + }, + "get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true + }, + "get-symbol-description": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.1.0.tgz", + "integrity": "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6" + } + }, + "get-tsconfig": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.10.0.tgz", + "integrity": "sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==", + "dev": true, + "requires": { + "resolve-pkg-maps": "^1.0.0" + } + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "15.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz", + "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", + "dev": true + }, + "globalthis": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", + "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "dev": true, + "requires": { + "define-properties": "^1.2.1", + "gopd": "^1.0.1" + } + }, + "gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true + }, + "graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0" + } + }, + "has-proto": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.2.0.tgz", + "integrity": "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ==", + "dev": true, + "requires": { + "dunder-proto": "^1.0.0" + } + }, + "has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true + }, + "has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.3" + } + }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "requires": { + "function-bind": "^1.1.2" + } + }, + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", + "dev": true + }, + "html-encoding-sniffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", + "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", + "dev": true, + "requires": { + "whatwg-encoding": "^2.0.0" + } + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "dev": true, + "requires": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "requires": { + "agent-base": "6", + "debug": "4" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true + }, + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + }, + "ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true + }, + "import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "dev": true, + "requires": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + } + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", + "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "internal-slot": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.1.0.tgz", + "integrity": "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "hasown": "^2.0.2", + "side-channel": "^1.1.0" + } + }, + "is-array-buffer": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", + "integrity": "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-async-function": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.1.1.tgz", + "integrity": "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==", + "dev": true, + "requires": { + "async-function": "^1.0.0", + "call-bound": "^1.0.3", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + } + }, + "is-bigint": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.1.0.tgz", + "integrity": "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==", + "dev": true, + "requires": { + "has-bigints": "^1.0.2" + } + }, + "is-boolean-object": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.2.2.tgz", + "integrity": "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + } + }, + "is-bun-module": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-1.3.0.tgz", + "integrity": "sha512-DgXeu5UWI0IsMQundYb5UAOzm6G2eVnarJ0byP6Tm55iZNKceD59LNPA2L4VvsScTtHcw0yEkVwSf7PC+QoLSA==", + "dev": true, + "requires": { + "semver": "^7.6.3" + }, + "dependencies": { + "semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true + } + } + }, + "is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true + }, + "is-core-module": { + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", + "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", + "dev": true, + "requires": { + "hasown": "^2.0.2" + } + }, + "is-data-view": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.2.tgz", + "integrity": "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "is-typed-array": "^1.1.13" + } + }, + "is-date-object": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.1.0.tgz", + "integrity": "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "has-tostringtag": "^1.0.2" + } + }, + "is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-finalizationregistry": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.1.1.tgz", + "integrity": "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==", + "dev": true, + "requires": { + "call-bound": "^1.0.3" + } + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true + }, + "is-generator-function": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.0.tgz", + "integrity": "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "get-proto": "^1.0.0", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + } + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dev": true, + "requires": { + "is-docker": "^3.0.0" + } + }, + "is-map": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", + "integrity": "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-number-object": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.1.1.tgz", + "integrity": "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + } + }, + "is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true + }, + "is-reference": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", + "dev": true, + "requires": { + "@types/estree": "*" + } + }, + "is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + } + }, + "is-set": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.3.tgz", + "integrity": "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==", + "dev": true + }, + "is-shared-array-buffer": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz", + "integrity": "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A==", + "dev": true, + "requires": { + "call-bound": "^1.0.3" + } + }, + "is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true + }, + "is-string": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz", + "integrity": "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "has-tostringtag": "^1.0.2" + } + }, + "is-symbol": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.1.1.tgz", + "integrity": "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "has-symbols": "^1.1.0", + "safe-regex-test": "^1.1.0" + } + }, + "is-typed-array": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.15.tgz", + "integrity": "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ==", + "dev": true, + "requires": { + "which-typed-array": "^1.1.16" + } + }, + "is-weakmap": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-weakmap/-/is-weakmap-2.0.2.tgz", + "integrity": "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==", + "dev": true + }, + "is-weakref": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.1.1.tgz", + "integrity": "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew==", + "dev": true, + "requires": { + "call-bound": "^1.0.3" + } + }, + "is-weakset": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.4.tgz", + "integrity": "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "get-intrinsic": "^1.2.6" + } + }, + "is-wsl": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", + "integrity": "sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==", + "dev": true, + "requires": { + "is-inside-container": "^1.0.0" + } + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "requires": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + } + }, + "istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "requires": { + "semver": "^7.5.3" + } + }, + "semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true + } + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "dependencies": { + "debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "requires": { + "ms": "^2.1.3" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "iterator.prototype": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.5.tgz", + "integrity": "sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "get-proto": "^1.0.0", + "has-symbols": "^1.1.0", + "set-function-name": "^2.0.2" + } + }, + "jest": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.6.4.tgz", + "integrity": "sha512-tEFhVQFF/bzoYV1YuGyzLPZ6vlPrdfvDmmAxudA1dLEuiztqg2Rkx20vkKY32xiDROcD2KXlgZ7Cu8RPeEHRKw==", + "dev": true, + "requires": { + "@jest/core": "^29.6.4", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.6.4" + } + }, + "jest-changed-files": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.6.3.tgz", + "integrity": "sha512-G5wDnElqLa4/c66ma5PG9eRjE342lIbF6SUnTJi26C3J28Fv2TVY2rOyKB9YGbSA5ogwevgmxc4j4aVjrEK6Yg==", + "dev": true, + "requires": { + "execa": "^5.0.0", + "jest-util": "^29.6.3", + "p-limit": "^3.1.0" + } + }, + "jest-circus": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.6.4.tgz", + "integrity": "sha512-YXNrRyntVUgDfZbjXWBMPslX1mQ8MrSG0oM/Y06j9EYubODIyHWP8hMUbjbZ19M3M+zamqEur7O80HODwACoJw==", + "dev": true, + "requires": { + "@jest/environment": "^29.6.4", + "@jest/expect": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.6.3", + "jest-matcher-utils": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-runtime": "^29.6.4", + "jest-snapshot": "^29.6.4", + "jest-util": "^29.6.3", + "p-limit": "^3.1.0", + "pretty-format": "^29.6.3", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + } + }, + "jest-cli": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.6.4.tgz", + "integrity": "sha512-+uMCQ7oizMmh8ZwRfZzKIEszFY9ksjjEQnTEMTaL7fYiL3Kw4XhqT9bYh+A4DQKUb67hZn2KbtEnDuHvcgK4pQ==", + "dev": true, + "requires": { + "@jest/core": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "import-local": "^3.0.2", + "jest-config": "^29.6.4", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "prompts": "^2.0.1", + "yargs": "^17.3.1" + } + }, + "jest-config": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.6.4.tgz", + "integrity": "sha512-JWohr3i9m2cVpBumQFv2akMEnFEPVOh+9L2xIBJhJ0zOaci2ZXuKJj0tgMKQCBZAKA09H049IR4HVS/43Qb19A==", + "dev": true, + "requires": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.6.4", + "@jest/types": "^29.6.3", + "babel-jest": "^29.6.4", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.6.4", + "jest-environment-node": "^29.6.4", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-runner": "^29.6.4", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.6.3", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + } + } + }, + "jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + } + }, + "jest-docblock": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.6.3.tgz", + "integrity": "sha512-2+H+GOTQBEm2+qFSQ7Ma+BvyV+waiIFxmZF5LdpBsAEjWX8QYjSCa4FrkIYtbfXUJJJnFCYrOtt6TZ+IAiTjBQ==", + "dev": true, + "requires": { + "detect-newline": "^3.0.0" + } + }, + "jest-each": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.6.3.tgz", + "integrity": "sha512-KoXfJ42k8cqbkfshW7sSHcdfnv5agDdHCPA87ZBdmHP+zJstTJc0ttQaJ/x7zK6noAL76hOuTIJ6ZkQRS5dcyg==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.6.3", + "pretty-format": "^29.6.3" + } + }, + "jest-environment-jsdom": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-29.6.4.tgz", + "integrity": "sha512-K6wfgUJ16DoMs02JYFid9lOsqfpoVtyJxpRlnTxUHzvZWBnnh2VNGRB9EC1Cro96TQdq5TtSjb3qUjNaJP9IyA==", + "dev": true, + "requires": { + "@jest/environment": "^29.6.4", + "@jest/fake-timers": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/jsdom": "^20.0.0", + "@types/node": "*", + "jest-mock": "^29.6.3", + "jest-util": "^29.6.3", + "jsdom": "^20.0.0" + } + }, + "jest-environment-node": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.6.4.tgz", + "integrity": "sha512-i7SbpH2dEIFGNmxGCpSc2w9cA4qVD+wfvg2ZnfQ7XVrKL0NA5uDVBIiGH8SR4F0dKEv/0qI5r+aDomDf04DpEQ==", + "dev": true, + "requires": { + "@jest/environment": "^29.6.4", + "@jest/fake-timers": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.6.3", + "jest-util": "^29.6.3" + } + }, + "jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true + }, + "jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "fsevents": "^2.3.2", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + } + }, + "jest-leak-detector": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.6.3.tgz", + "integrity": "sha512-0kfbESIHXYdhAdpLsW7xdwmYhLf1BRu4AA118/OxFm0Ho1b2RcTmO4oF6aAMaxpxdxnJ3zve2rgwzNBD4Zbm7Q==", + "dev": true, + "requires": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.6.3" + } + }, + "jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + } + }, + "jest-message-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + } + }, + "jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + } + }, + "jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, + "requires": {} + }, + "jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "dev": true + }, + "jest-resolve": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.6.4.tgz", + "integrity": "sha512-fPRq+0vcxsuGlG0O3gyoqGTAxasagOxEuyoxHeyxaZbc9QNek0AmJWSkhjlMG+mTsj+8knc/mWb3fXlRNVih7Q==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.6.3", + "jest-validate": "^29.6.3", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + } + }, + "jest-resolve-dependencies": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.6.4.tgz", + "integrity": "sha512-7+6eAmr1ZBF3vOAJVsfLj1QdqeXG+WYhidfLHBRZqGN24MFRIiKG20ItpLw2qRAsW/D2ZUUmCNf6irUr/v6KHA==", + "dev": true, + "requires": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.6.4" + } + }, + "jest-runner": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.6.4.tgz", + "integrity": "sha512-SDaLrMmtVlQYDuG0iSPYLycG8P9jLI+fRm8AF/xPKhYDB2g6xDWjXBrR5M8gEWsK6KVFlebpZ4QsrxdyIX1Jaw==", + "dev": true, + "requires": { + "@jest/console": "^29.6.4", + "@jest/environment": "^29.6.4", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.6.3", + "jest-environment-node": "^29.6.4", + "jest-haste-map": "^29.6.4", + "jest-leak-detector": "^29.6.3", + "jest-message-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-runtime": "^29.6.4", + "jest-util": "^29.6.3", + "jest-watcher": "^29.6.4", + "jest-worker": "^29.6.4", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "dependencies": { + "source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + } + } + }, + "jest-runtime": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.6.4.tgz", + "integrity": "sha512-s/QxMBLvmwLdchKEjcLfwzP7h+jsHvNEtxGP5P+Fl1FMaJX2jMiIqe4rJw4tFprzCwuSvVUo9bn0uj4gNRXsbA==", + "dev": true, + "requires": { + "@jest/environment": "^29.6.4", + "@jest/fake-timers": "^29.6.4", + "@jest/globals": "^29.6.4", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.6.4", + "@jest/transform": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.6.4", + "jest-message-util": "^29.6.3", + "jest-mock": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.6.4", + "jest-snapshot": "^29.6.4", + "jest-util": "^29.6.3", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + } + }, + "jest-snapshot": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", + "dev": true, + "requires": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "dependencies": { + "semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true + } + } + }, + "jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + } + }, + "jest-validate": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.6.3.tgz", + "integrity": "sha512-e7KWZcAIX+2W1o3cHfnqpGajdCs1jSM3DkXjGeLSNmCazv1EeI1ggTeK5wdZhF+7N+g44JI2Od3veojoaumlfg==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.6.3" + }, + "dependencies": { + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true + } + } + }, + "jest-watcher": { + "version": "29.6.4", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.6.4.tgz", + "integrity": "sha512-oqUWvx6+On04ShsT00Ir9T4/FvBeEh2M9PTubgITPxDa739p4hoQweWPRGyYeaojgT0xTpZKF0Y/rSY1UgMxvQ==", + "dev": true, + "requires": { + "@jest/test-result": "^29.6.4", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.6.3", + "string-length": "^4.0.1" + } + }, + "jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "dev": true, + "requires": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "dependencies": { + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jiti": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.4.2.tgz", + "integrity": "sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsdom": { + "version": "20.0.3", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-20.0.3.tgz", + "integrity": "sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==", + "dev": true, + "requires": { + "abab": "^2.0.6", + "acorn": "^8.8.1", + "acorn-globals": "^7.0.0", + "cssom": "^0.5.0", + "cssstyle": "^2.3.0", + "data-urls": "^3.0.2", + "decimal.js": "^10.4.2", + "domexception": "^4.0.0", + "escodegen": "^2.0.0", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^3.0.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.1", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.2", + "parse5": "^7.1.1", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^4.1.2", + "w3c-xmlserializer": "^4.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^2.0.0", + "whatwg-mimetype": "^3.0.0", + "whatwg-url": "^11.0.0", + "ws": "^8.11.0", + "xml-name-validator": "^4.0.0" + }, + "dependencies": { + "acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true + }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "tough-cookie": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", + "dev": true, + "requires": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + } + }, + "universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "dev": true + } + } + }, + "jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true + }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true + }, + "json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true + }, + "jsonml-html": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/jsonml-html/-/jsonml-html-1.2.0.tgz", + "integrity": "sha512-vg30gQFD5X+1nY3do43BW9Iiq4F5BZcysXc+ydPNu7O5AxaqxnaI9ikjTjlE9y9KaAvgTwTP6nOpifDqDoYmjg==", + "dev": true + }, + "jsx-ast-utils": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", + "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", + "dev": true, + "requires": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" + } + }, + "junk": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/junk/-/junk-4.0.1.tgz", + "integrity": "sha512-Qush0uP+G8ZScpGMZvHUiRfI0YBWuB3gVBYlI0v0vvOJt5FLicco+IkP0a50LqTTQhmts/m6tP5SWE+USyIvcQ==", + "dev": true + }, + "keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "requires": { + "json-buffer": "3.0.1" + } + }, + "kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true + }, + "leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "dev": true + }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true + } + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "magic-string": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.9.tgz", + "integrity": "sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.8" + } + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "make-synchronous": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/make-synchronous/-/make-synchronous-0.1.1.tgz", + "integrity": "sha512-Y4SxxqhaoyMDokJQ0AZz0E+bLhRkOSR7Z/IQoTKPdS6HYi3aobal2kMHoHHoqBadPWjf07P4K1FQLXOx3wf9Yw==", + "dev": true, + "requires": { + "subsume": "^3.0.0", + "type-fest": "^0.16.0" + }, + "dependencies": { + "type-fest": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.16.0.tgz", + "integrity": "sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg==", + "dev": true + } + } + }, + "makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "requires": { + "tmpl": "1.0.5" + } + }, + "marked": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-11.2.0.tgz", + "integrity": "sha512-HR0m3bvu0jAPYiIvLUUQtdg1g6D247//lvcekpHO1WMvbwDlwSkZAX9Lw4F4YHE1T0HaaNve0tuAWuV1UJ6vtw==", + "dev": true + }, + "marked-highlight": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/marked-highlight/-/marked-highlight-2.1.0.tgz", + "integrity": "sha512-peBvgGZZqUw074Vy/N8Y7/6JQhSnR54/T0Ozq2/fAIBzcYfVfExFdQJptIhQxreR1elpwvJRrqhp6S/Prk8prA==", + "dev": true, + "requires": {} + }, + "math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true + }, + "memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha1-htcJCzDORV1j+64S3aUaR93K+bI=", + "dev": true + }, + "meow": { + "version": "12.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-12.1.1.tgz", + "integrity": "sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==", + "dev": true + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "requires": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + } + }, + "microtime": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/microtime/-/microtime-3.1.1.tgz", + "integrity": "sha512-to1r7o24cDsud9IhN6/8wGmMx5R2kT0w2Xwm5okbYI3d1dk6Xv0m+Z+jg2vS9pt+ocgQHTCtgs/YuyJhySzxNg==", + "dev": true, + "requires": { + "node-addon-api": "^5.0.0", + "node-gyp-build": "^4.4.0" + } + }, + "mime-db": { + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz", + "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==", + "dev": true + }, + "mime-types": { + "version": "2.1.32", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz", + "integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==", + "dev": true, + "requires": { + "mime-db": "1.49.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true + }, + "nanoid": { + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.10.tgz", + "integrity": "sha512-vSJJTG+t/dIKAUhUDw/dLdZ9s//5OxcHqLaDWWrW4Cdq7o6tdLIczUkMXt2MBNmk6sJRZBZRXVixs7URY1CmIg==", + "dev": true + }, + "nanospinner": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/nanospinner/-/nanospinner-1.2.2.tgz", + "integrity": "sha512-Zt/AmG6qRU3e+WnzGGLuMCEAO/dAu45stNbHY223tUxldaDAeE+FxSPsd9Q+j+paejmm0ZbrNVs5Sraqy3dRxA==", + "dev": true, + "requires": { + "picocolors": "^1.1.1" + } + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "nested-error-stacks": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.1.tgz", + "integrity": "sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==", + "dev": true + }, + "next": { + "version": "15.2.4", + "resolved": "https://registry.npmjs.org/next/-/next-15.2.4.tgz", + "integrity": "sha512-VwL+LAaPSxEkd3lU2xWbgEOtrM8oedmyhBqaVNmgKB+GvZlCy9rgaEc+y2on0wv+l0oSFqLtYD6dcC1eAedUaQ==", + "dev": true, + "requires": { + "@next/env": "15.2.4", + "@next/swc-darwin-arm64": "15.2.4", + "@next/swc-darwin-x64": "15.2.4", + "@next/swc-linux-arm64-gnu": "15.2.4", + "@next/swc-linux-arm64-musl": "15.2.4", + "@next/swc-linux-x64-gnu": "15.2.4", + "@next/swc-linux-x64-musl": "15.2.4", + "@next/swc-win32-arm64-msvc": "15.2.4", + "@next/swc-win32-x64-msvc": "15.2.4", + "@swc/counter": "0.1.3", + "@swc/helpers": "0.5.15", + "busboy": "1.6.0", + "caniuse-lite": "^1.0.30001579", + "postcss": "8.4.31", + "sharp": "^0.33.5", + "styled-jsx": "5.1.6" + } + }, + "next-sitemap": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/next-sitemap/-/next-sitemap-4.2.3.tgz", + "integrity": "sha512-vjdCxeDuWDzldhCnyFCQipw5bfpl4HmZA7uoo3GAaYGjGgfL4Cxb1CiztPuWGmS+auYs7/8OekRS8C2cjdAsjQ==", + "dev": true, + "requires": { + "@corex/deepmerge": "^4.0.43", + "@next/env": "^13.4.3", + "fast-glob": "^3.2.12", + "minimist": "^1.2.8" + }, + "dependencies": { + "@next/env": { + "version": "13.5.8", + "resolved": "https://registry.npmjs.org/@next/env/-/env-13.5.8.tgz", + "integrity": "sha512-YmiG58BqyZ2FjrF2+5uZExL2BrLr8RTQzLXNDJ8pJr0O+rPlOeDPXp1p1/4OrR3avDidzZo3D8QO2cuDv1KCkw==", + "dev": true + } + } + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-addon-api": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", + "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==", + "dev": true + }, + "node-gyp-build": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.2.tgz", + "integrity": "sha512-IRUxE4BVsHWXkV/SFOut4qTlagw2aM8T5/vnTsmrHJvVoKueJHRc/JaFND7QDDc61kLYUJ6qlZM3sqTSyx2dTw==", + "dev": true + }, + "node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true + }, + "node-releases": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true + } + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "npm-run-all": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "memorystream": "^0.3.1", + "minimatch": "^3.0.4", + "pidtree": "^0.3.0", + "read-pkg": "^3.0.0", + "shell-quote": "^1.6.1", + "string.prototype.padend": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "cross-spawn": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true + }, + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "nwsapi": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", + "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true + }, + "object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.7.tgz", + "integrity": "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0", + "has-symbols": "^1.1.0", + "object-keys": "^1.1.1" + } + }, + "object.entries": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", + "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + } + }, + "object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + } + }, + "object.groupby": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", + "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2" + } + }, + "object.values": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.1.tgz", + "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "open": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/open/-/open-10.1.0.tgz", + "integrity": "sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw==", + "dev": true, + "requires": { + "default-browser": "^5.2.1", + "define-lazy-prop": "^3.0.0", + "is-inside-container": "^1.0.0", + "is-wsl": "^3.1.0" + } + }, + "optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + } + }, + "own-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/own-keys/-/own-keys-1.0.1.tgz", + "integrity": "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.6", + "object-keys": "^1.1.1", + "safe-push-apply": "^1.0.0" + } + }, + "p-event": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/p-event/-/p-event-5.0.1.tgz", + "integrity": "sha512-dd589iCQ7m1L0bmC5NLlVYfy3TbBEsMUfWx9PyAgPeIcFZ/E2yaTZ4Rz4MiBmmJShviiftHVXOqfnfzJ6kyMrQ==", + "dev": true, + "requires": { + "p-timeout": "^5.0.2" + } + }, + "p-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-filter/-/p-filter-3.0.0.tgz", + "integrity": "sha512-QtoWLjXAW++uTX67HZQz1dbTpqBfiidsB6VtQUC9iR85S120+s0T5sO6s+B5MLzFcZkrEd/DGMmCjR+f2Qpxwg==", + "dev": true, + "requires": { + "p-map": "^5.1.0" + }, + "dependencies": { + "p-map": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-5.5.0.tgz", + "integrity": "sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg==", + "dev": true, + "requires": { + "aggregate-error": "^4.0.0" + } + } + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "p-map": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-6.0.0.tgz", + "integrity": "sha512-T8BatKGY+k5rU+Q/GTYgrEf2r4xRMevAN5mtXc2aPc4rS1j3s+vWTaO2Wag94neXuCAUAs8cxBL9EeB5EA6diw==", + "dev": true + }, + "p-timeout": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", + "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==", + "dev": true + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "dev": true, + "requires": { + "entities": "^4.4.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, + "pidtree": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.1.tgz", + "integrity": "sha512-qQbW94hLHEqCg7nhby4yRC7G2+jYHY4Rguc2bjw7Uug4GIJuu1tvf2uHaZv5Q8zdt+WKJ6qK1FOI6amaWUo5FA==", + "dev": true + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==", + "dev": true + }, + "pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "dev": true + }, + "platform": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", + "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==", + "dev": true + }, + "possible-typed-array-names": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz", + "integrity": "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==", + "dev": true + }, + "postcss": { + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", + "dev": true, + "requires": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + } + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "prettier": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.0.tgz", + "integrity": "sha512-quyMrVt6svPS7CjQ9gKb3GLEX/rl3BCL2oa/QkNcXv4YNVBC9olt3s+H7ukto06q7B1Qz46PbrKLO34PR6vXcA==", + "dev": true + }, + "pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "requires": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true + }, + "react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + } + } + }, + "prismjs": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz", + "integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==", + "dev": true + }, + "prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "requires": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + } + }, + "prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dev": true, + "requires": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true + }, + "pure-rand": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.2.tgz", + "integrity": "sha512-6Yg0ekpKICSjPswYOuC5sku/TSWaRYlA0qsXqJgM/d/4pLPHPuTxK7Nbf7jFKzAeedUhR8C7K9Uv63FBsSo8xQ==", + "dev": true + }, + "querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "dev": true + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, + "random-seed": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/random-seed/-/random-seed-0.3.0.tgz", + "integrity": "sha512-y13xtn3kcTlLub3HKWXxJNeC2qK4mB59evwZ5EkeRlolx+Bp2ztF7LbcZmyCnOqlHQrLnfuNbi1sVmm9lPDlDA==", + "dev": true, + "requires": { + "json-stringify-safe": "^5.0.1" + } + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "react": { + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz", + "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==", + "dev": true + }, + "react-dom": { + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.0.tgz", + "integrity": "sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==", + "dev": true, + "requires": { + "scheduler": "^0.26.0" + } + }, + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "dependencies": { + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + } + } + }, + "readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true + }, + "reflect.getprototypeof": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", + "integrity": "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.9", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.7", + "get-proto": "^1.0.1", + "which-builtin-type": "^1.2.1" + } + }, + "regenerate": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", + "dev": true + }, + "regenerate-unicode-properties": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", + "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", + "dev": true, + "requires": { + "regenerate": "^1.4.0" + } + }, + "regexp.prototype.flags": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz", + "integrity": "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-errors": "^1.3.0", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "set-function-name": "^2.0.2" + } + }, + "regjsgen": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", + "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", + "dev": true + }, + "regjsparser": { + "version": "0.6.9", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz", + "integrity": "sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ==", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==", + "dev": true + } + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "dev": true + }, + "resolve": { + "version": "1.22.10", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.10.tgz", + "integrity": "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==", + "dev": true, + "requires": { + "is-core-module": "^2.16.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "requires": { + "resolve-from": "^5.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true + }, + "resolve.exports": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "dev": true + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "rollup": { + "version": "4.34.8", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.34.8.tgz", + "integrity": "sha512-489gTVMzAYdiZHFVA/ig/iYFllCcWFHMvUHI1rpFmkoUtRlQxqh6/yiNqnYibjMZ2b/+FUQwldG+aLsEt6bglQ==", + "dev": true, + "requires": { + "@rollup/rollup-android-arm-eabi": "4.34.8", + "@rollup/rollup-android-arm64": "4.34.8", + "@rollup/rollup-darwin-arm64": "4.34.8", + "@rollup/rollup-darwin-x64": "4.34.8", + "@rollup/rollup-freebsd-arm64": "4.34.8", + "@rollup/rollup-freebsd-x64": "4.34.8", + "@rollup/rollup-linux-arm-gnueabihf": "4.34.8", + "@rollup/rollup-linux-arm-musleabihf": "4.34.8", + "@rollup/rollup-linux-arm64-gnu": "4.34.8", + "@rollup/rollup-linux-arm64-musl": "4.34.8", + "@rollup/rollup-linux-loongarch64-gnu": "4.34.8", + "@rollup/rollup-linux-powerpc64le-gnu": "4.34.8", + "@rollup/rollup-linux-riscv64-gnu": "4.34.8", + "@rollup/rollup-linux-s390x-gnu": "4.34.8", + "@rollup/rollup-linux-x64-gnu": "4.34.8", + "@rollup/rollup-linux-x64-musl": "4.34.8", + "@rollup/rollup-win32-arm64-msvc": "4.34.8", + "@rollup/rollup-win32-ia32-msvc": "4.34.8", + "@rollup/rollup-win32-x64-msvc": "4.34.8", + "@types/estree": "1.0.6", + "fsevents": "~2.3.2" + } + }, + "run-applescript": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz", + "integrity": "sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A==", + "dev": true + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "safe-array-concat": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.3.tgz", + "integrity": "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "get-intrinsic": "^1.2.6", + "has-symbols": "^1.1.0", + "isarray": "^2.0.5" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "safe-push-apply": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-push-apply/-/safe-push-apply-1.0.0.tgz", + "integrity": "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "isarray": "^2.0.5" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, + "safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "requires": { + "xmlchars": "^2.2.0" + } + }, + "scheduler": { + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz", + "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==", + "dev": true + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + }, + "serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, + "set-function-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", + "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "functions-have-names": "^1.2.3", + "has-property-descriptors": "^1.0.2" + } + }, + "set-proto": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/set-proto/-/set-proto-1.0.0.tgz", + "integrity": "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==", + "dev": true, + "requires": { + "dunder-proto": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0" + } + }, + "sharp": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz", + "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==", + "dev": true, + "optional": true, + "requires": { + "@img/sharp-darwin-arm64": "0.33.5", + "@img/sharp-darwin-x64": "0.33.5", + "@img/sharp-libvips-darwin-arm64": "1.0.4", + "@img/sharp-libvips-darwin-x64": "1.0.4", + "@img/sharp-libvips-linux-arm": "1.0.5", + "@img/sharp-libvips-linux-arm64": "1.0.4", + "@img/sharp-libvips-linux-s390x": "1.0.4", + "@img/sharp-libvips-linux-x64": "1.0.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", + "@img/sharp-libvips-linuxmusl-x64": "1.0.4", + "@img/sharp-linux-arm": "0.33.5", + "@img/sharp-linux-arm64": "0.33.5", + "@img/sharp-linux-s390x": "0.33.5", + "@img/sharp-linux-x64": "0.33.5", + "@img/sharp-linuxmusl-arm64": "0.33.5", + "@img/sharp-linuxmusl-x64": "0.33.5", + "@img/sharp-wasm32": "0.33.5", + "@img/sharp-win32-ia32": "0.33.5", + "@img/sharp-win32-x64": "0.33.5", + "color": "^4.2.3", + "detect-libc": "^2.0.3", + "semver": "^7.6.3" + }, + "dependencies": { + "semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "optional": true + } + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "shell-quote": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.2.tgz", + "integrity": "sha512-AzqKpGKjrj7EM6rKVQEPpB288oCfnrEIuyoT9cyF4nmGa7V8Zk6f7RRqYisX8X9m+Q7bd632aZW4ky7EhbQztA==", + "dev": true + }, + "side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + } + }, + "side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "requires": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + } + }, + "side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + } + }, + "side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + } + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "dev": true, + "optional": true, + "requires": { + "is-arrayish": "^0.3.1" + }, + "dependencies": { + "is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "dev": true, + "optional": true + } + } + }, + "sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "size-limit": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/size-limit/-/size-limit-11.2.0.tgz", + "integrity": "sha512-2kpQq2DD/pRpx3Tal/qRW1SYwcIeQ0iq8li5CJHQgOC+FtPn2BVmuDtzUCgNnpCrbgtfEHqh+iWzxK+Tq6C+RQ==", + "dev": true, + "requires": { + "bytes-iec": "^3.1.1", + "chokidar": "^4.0.3", + "jiti": "^2.4.2", + "lilconfig": "^3.1.3", + "nanospinner": "^1.2.2", + "picocolors": "^1.1.1", + "tinyglobby": "^0.2.11" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "smob": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/smob/-/smob-1.4.0.tgz", + "integrity": "sha512-MqR3fVulhjWuRNSMydnTlweu38UhQ0HXM4buStD/S3mc/BzX3CuM9OmhyQpmtYCvoYdl5ris6TI0ZqH355Ymqg==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "dev": true + }, + "source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "dev": true + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz", + "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "stable-hash": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/stable-hash/-/stable-hash-0.0.4.tgz", + "integrity": "sha512-LjdcbuBeLcdETCrPn9i8AYAZ1eCtu4ECAWtP7UleOiZ9LzVxRzzUZEoZ8zB24nhkQnDWyET0I+3sWokSDS3E7g==", + "dev": true + }, + "stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + } + } + }, + "streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "dev": true + }, + "string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "requires": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + } + }, + "string.prototype.matchall": { + "version": "4.0.12", + "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz", + "integrity": "sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "regexp.prototype.flags": "^1.5.3", + "set-function-name": "^2.0.2", + "side-channel": "^1.1.0" + } + }, + "string.prototype.padend": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.padend/-/string.prototype.padend-3.1.2.tgz", + "integrity": "sha512-/AQFLdYvePENU3W5rgurfWSMU6n+Ww8n/3cUt7E+vPBB/D7YDG8x+qjoFs4M/alR2bW7Qg6xMjVwWUOvuQ0XpQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.2" + } + }, + "string.prototype.repeat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz", + "integrity": "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string.prototype.trim": { + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", + "integrity": "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-data-property": "^1.1.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-object-atoms": "^1.0.0", + "has-property-descriptors": "^1.0.2" + } + }, + "string.prototype.trimend": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.9.tgz", + "integrity": "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.2", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", + "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "style-mod": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.2.tgz", + "integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==", + "dev": true + }, + "styled-jsx": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.6.tgz", + "integrity": "sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==", + "dev": true, + "requires": { + "client-only": "0.0.1" + } + }, + "subsume": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/subsume/-/subsume-3.0.0.tgz", + "integrity": "sha512-6n/UfV8UWKwJNO8OAOiKntwEMihuBeeoJfzpL542C+OuvT4iWG9SwjrXkOmsxjb4SteHUsos9SvrdqZ9+ICwTQ==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0", + "unique-string": "^2.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + } + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, + "symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true + }, + "tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true + }, + "terser": { + "version": "5.19.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.2.tgz", + "integrity": "sha512-qC5+dmecKJA4cpYxRa5aVkKehYsQKc+AHeKl0Oe62aYjBL8ZA33tTljktDHJSaxxMnbI5ZYw+o/S2DxxLu8OfA==", + "dev": true, + "requires": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "dependencies": { + "acorn": { + "version": "8.14.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", + "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "dev": true + } + } + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + } + }, + "tinyglobby": { + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", + "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==", + "dev": true, + "requires": { + "fdir": "^6.4.3", + "picomatch": "^4.0.2" + }, + "dependencies": { + "fdir": { + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", + "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "dev": true, + "requires": {} + }, + "picomatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", + "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "dev": true + } + } + }, + "tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "tr46": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-3.0.0.tgz", + "integrity": "sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==", + "dev": true, + "requires": { + "punycode": "^2.1.1" + } + }, + "transducers-js": { + "version": "0.4.174", + "resolved": "https://registry.npmjs.org/transducers-js/-/transducers-js-0.4.174.tgz", + "integrity": "sha1-1YYsEO/0vj0zIqv2u3QuMPG7b8Q=", + "dev": true + }, + "ts-api-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", + "integrity": "sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==", + "dev": true, + "requires": {} + }, + "ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "requires": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "dependencies": { + "acorn": { + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "dev": true + } + } + }, + "tsconfig-paths": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", + "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true + } + } + }, + "tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true + }, + "tstyche": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/tstyche/-/tstyche-3.5.0.tgz", + "integrity": "sha512-N4SUp/ZWaMGEcglpVFIzKez0GQEiBdfFDgcnqwv9O1mePZgos8N1cZCzNgGtPGo/w0ym04MjJcDnsw1sorEzgA==", + "dev": true, + "requires": {} + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "typed-array-buffer": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz", + "integrity": "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "es-errors": "^1.3.0", + "is-typed-array": "^1.1.14" + } + }, + "typed-array-byte-length": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.3.tgz", + "integrity": "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg==", + "dev": true, + "requires": { + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.14" + } + }, + "typed-array-byte-offset": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.4.tgz", + "integrity": "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-proto": "^1.2.0", + "is-typed-array": "^1.1.15", + "reflect.getprototypeof": "^1.0.9" + } + }, + "typed-array-length": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.7.tgz", + "integrity": "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==", + "dev": true, + "requires": { + "call-bind": "^1.0.7", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "is-typed-array": "^1.1.13", + "possible-typed-array-names": "^1.0.0", + "reflect.getprototypeof": "^1.0.6" + } + }, + "typescript": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", + "dev": true + }, + "typescript-eslint": { + "version": "8.24.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.24.0.tgz", + "integrity": "sha512-/lmv4366en/qbB32Vz5+kCNZEMf6xYHwh1z48suBwZvAtnXKbP+YhGe8OLE2BqC67LMqKkCNLtjejdwsdW6uOQ==", + "dev": true, + "requires": { + "@typescript-eslint/eslint-plugin": "8.24.0", + "@typescript-eslint/parser": "8.24.0", + "@typescript-eslint/utils": "8.24.0" + } + }, + "unbox-primitive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.1.0.tgz", + "integrity": "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw==", + "dev": true, + "requires": { + "call-bound": "^1.0.3", + "has-bigints": "^1.0.2", + "has-symbols": "^1.1.0", + "which-boxed-primitive": "^1.1.1" + } + }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", + "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", + "dev": true + }, + "unicode-property-aliases-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", + "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", + "dev": true + }, + "unique-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", + "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", + "dev": true, + "requires": { + "crypto-random-string": "^2.0.0" + } + }, + "update-browserslist-db": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz", + "integrity": "sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==", + "dev": true, + "requires": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + } + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "dev": true, + "requires": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "v8-to-istanbul": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", + "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0" + } + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "w3c-keyname": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", + "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==", + "dev": true + }, + "w3c-xmlserializer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", + "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", + "dev": true, + "requires": { + "xml-name-validator": "^4.0.0" + } + }, + "walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "requires": { + "makeerror": "1.0.12" + } + }, + "webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true + }, + "whatwg-encoding": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", + "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", + "dev": true, + "requires": { + "iconv-lite": "0.6.3" + } + }, + "whatwg-mimetype": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "dev": true + }, + "whatwg-url": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-11.0.0.tgz", + "integrity": "sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==", + "dev": true, + "requires": { + "tr46": "^3.0.0", + "webidl-conversions": "^7.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-boxed-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz", + "integrity": "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA==", + "dev": true, + "requires": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + } + }, + "which-builtin-type": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.2.1.tgz", + "integrity": "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==", + "dev": true, + "requires": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "dependencies": { + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + } + } + }, + "which-collection": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", + "integrity": "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==", + "dev": true, + "requires": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + } + }, + "which-typed-array": { + "version": "1.1.18", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.18.tgz", + "integrity": "sha512-qEcY+KJYlWyLH9vNbsr6/5j59AXk5ni5aakf8ldzBvGde6Iz4sxZGkJyWSAueTG7QhOvNRYb1lDdFmL5Td0QKA==", + "dev": true, + "requires": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "for-each": "^0.3.3", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + } + }, + "word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + } + }, + "ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==", + "dev": true, + "requires": {} + }, + "xml-name-validator": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", + "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "dev": true + }, + "xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, + "yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "requires": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "dependencies": { + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true + } + } + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true + } + } +} diff --git a/package.json b/package.json index e4ef93c566..e773736d96 100644 --- a/package.json +++ b/package.json @@ -1,62 +1,27 @@ { "name": "immutable", - "version": "3.7.2", + "version": "5.1.2", "description": "Immutable Data Collections", - "homepage": "https://github.com/facebook/immutable-js", + "license": "MIT", + "homepage": "https://immutable-js.com", "author": { "name": "Lee Byron", "url": "https://github.com/leebyron" }, "repository": { "type": "git", - "url": "git://github.com/facebook/immutable-js.git" + "url": "git://github.com/immutable-js/immutable-js.git" }, "bugs": { - "url": "https://github.com/facebook/immutable-js/issues" + "url": "https://github.com/immutable-js/immutable-js/issues" }, "main": "dist/immutable.js", - "scripts": { - "test": "./resources/node_test.sh", - "perf": "node ./resources/bench.js" - }, - "jest": { - "scriptPreprocessor": "resources/jestPreprocessor.js", - "testFileExtensions": [ - "js", - "ts" - ], - "persistModuleRegistryBetweenSpecs": true - }, - "devDependencies": { - "acorn": "^0.11.0", - "benchmark": "^1.0.0", - "bluebird": "^2.7.1", - "colors": "^1.0.3", - "es6-transpiler": "^0.7.18", - "esperanto": "^0.6.0", - "estraverse": "^1.9.1", - "grunt": "^0.4.5", - "grunt-contrib-clean": "^0.5.0", - "grunt-contrib-copy": "^0.5.0", - "grunt-contrib-jshint": "^0.10.0", - "grunt-jest": "^0.1.0", - "grunt-release": "^0.7.0", - "jasmine-check": "^0.1.2", - "magic-string": "^0.2.6", - "microtime": "^1.2.0", - "react-tools": "^0.11.1", - "typescript": "~1.4.1", - "uglify-js": "^2.4.15" - }, - "engines": { - "node": ">=0.8.0" - }, + "module": "dist/immutable.es.js", + "types": "dist/immutable.d.ts", "files": [ "dist", - "contrib", "README.md", - "LICENSE", - "PATENTS" + "LICENSE" ], "keywords": [ "immutable", @@ -70,5 +35,127 @@ "sequence", "iteration" ], - "license": "BSD" + "publishKeys": [ + "name", + "version", + "description", + "license", + "homepage", + "author", + "repository", + "bugs", + "main", + "module", + "sideEffects", + "types", + "files", + "keywords" + ], + "engines": { + "npm": ">=7.0.0" + }, + "scripts": { + "test": "run-s format lint type-check build test:*", + "test:unit": "jest", + "test:types": "tstyche", + "format": "npm run lint:format -- --write", + "lint": "run-s lint:*", + "lint:format": "prettier --check \"{__tests__,src,type-definitions,website/src,perf,resources}/**/*{.js,.mjs,.ts,.tsx,.flow,.css}\"", + "lint:js": "eslint", + "type-check": "run-s type-check:*", + "type-check:ts": "tsc --project tsconfig.src.json && tsc --project type-definitions/tsconfig.json && tsc --project __tests__/tsconfig.json", + "type-check:flow": "flow check type-definitions/flow-tests --include-warnings", + "build": "run-s build:*", + "build:clean": "rimraf dist", + "build:dist": "rollup -c ./resources/rollup-config.mjs", + "build:types": "cpy \"./type-definitions/immutable.*\" dist", + "build:prepare": "./resources/prepare-dist.sh", + "build:stats": "node ./resources/dist-stats.mjs", + "website:build": "cd website && next build && next-sitemap", + "website:dev": "cd website && next dev --turbopack", + "check-build-output": "node ./resources/check-build-output.mjs", + "check-git-clean": "./resources/check-git-clean.sh", + "benchmark": "node ./resources/benchmark.js", + "publish": "echo 'ONLY PUBLISH VIA CI'; exit 1;" + }, + "prettier": { + "singleQuote": true, + "trailingComma": "es5" + }, + "devDependencies": { + "@codemirror/commands": "^6.8.1", + "@codemirror/lang-javascript": "^6.2.3", + "@codemirror/state": "^6.5.2", + "@codemirror/theme-one-dark": "^6.1.2", + "@codemirror/view": "^6.36.5", + "@eslint/js": "^9.20.0", + "@jdeniau/immutable-devtools": "^0.2.0", + "@jest/globals": "^29.7.0", + "@rollup/plugin-buble": "1.0.3", + "@rollup/plugin-commonjs": "28.0.2", + "@rollup/plugin-json": "6.1.0", + "@rollup/plugin-terser": "^0.4.4", + "@rollup/plugin-typescript": "^12.1.2", + "@size-limit/esbuild-why": "^11.2.0", + "@size-limit/preset-small-lib": "^11.2.0", + "@types/prismjs": "^1.26.3", + "@types/random-seed": "0.3.5", + "@types/react": "19.1.0", + "benchmark": "2.1.4", + "codemirror": "^6.0.1", + "colors": "1.4.0", + "cpy-cli": "^5.0.0", + "eslint": "^9.20.1", + "eslint-import-resolver-typescript": "^3.7.0", + "eslint-plugin-import": "^2.31.0", + "eslint-plugin-jest": "^28.11.0", + "eslint-plugin-react": "^7.37.4", + "fast-check": "^4.0.0", + "flow-bin": "0.160.0", + "globals": "^15.15.0", + "jest": "^29.0.0", + "jest-environment-jsdom": "^29.6.4", + "jsonml-html": "^1.2.0", + "make-synchronous": "0.1.1", + "marked": "^11.2.0", + "marked-highlight": "^2.1.0", + "microtime": "3.1.1", + "next": "15.2.4", + "next-sitemap": "4.2.3", + "npm-run-all": "4.1.5", + "prettier": "^3.5.0", + "prismjs": "^1.29.0", + "random-seed": "0.3.0", + "react": "19.1.0", + "react-dom": "19.1.0", + "rimraf": "2.7.1", + "rollup": "4.34.8", + "size-limit": "^11.2.0", + "transducers-js": "0.4.174", + "ts-node": "^10.9.2", + "tslib": "^2.8.1", + "tstyche": "^3.5", + "typescript": "5.7", + "typescript-eslint": "^8.24.0" + }, + "size-limit": [ + { + "name": "all", + "path": "dist/immutable.es.js", + "import": "*", + "limit": "20 kB" + }, + { + "name": "List", + "path": "dist/immutable.es.js", + "import": "{ List }", + "limit": "20 kB" + }, + { + "name": "Seq", + "path": "dist/immutable.es.js", + "import": "{ Seq }", + "limit": "20 kB" + } + ] } diff --git a/perf/List.js b/perf/List.js index a132aa89f7..375155e46d 100644 --- a/perf/List.js +++ b/perf/List.js @@ -1,47 +1,44 @@ +/* global Immutable */ describe('List', function () { - describe('builds from array', function () { + var array2 = []; + for (var ii = 0; ii < 2; ii++) { + array2[ii] = ii; + } - var array2 = []; - for (var ii = 0; ii < 2; ii++) { - array2[ii] = ii; - } - - it('of 2', function () { - Immutable.List(array2); - }); - - var array8 = []; - for (var ii = 0; ii < 8; ii++) { - array8[ii] = ii; - } + it('of 2', function () { + Immutable.List(array2); + }); - it('of 8', function () { - Immutable.List(array8); - }); + var array8 = []; + for (var ii = 0; ii < 8; ii++) { + array8[ii] = ii; + } - var array32 = []; - for (var ii = 0; ii < 32; ii++) { - array32[ii] = ii; - } + it('of 8', function () { + Immutable.List(array8); + }); - it('of 32', function () { - Immutable.List(array32); - }); + var array32 = []; + for (var ii = 0; ii < 32; ii++) { + array32[ii] = ii; + } - var array1024 = []; - for (var ii = 0; ii < 1024; ii++) { - array1024[ii] = ii; - } + it('of 32', function () { + Immutable.List(array32); + }); - it('of 1024', function () { - Immutable.List(array1024); - }); + var array1024 = []; + for (var ii = 0; ii < 1024; ii++) { + array1024[ii] = ii; + } + it('of 1024', function () { + Immutable.List(array1024); + }); }); describe('pushes into', function () { - it('2 times', function () { var list = Immutable.List(); for (var ii = 0; ii < 2; ii++) { @@ -69,11 +66,9 @@ describe('List', function () { list = list.push(ii); } }); - }); describe('pushes into transient', function () { - it('2 times', function () { var list = Immutable.List().asMutable(); for (var ii = 0; ii < 2; ii++) { @@ -105,8 +100,15 @@ describe('List', function () { } list = list.asImmutable(); }); - }); - + describe('some', function () { + it('100 000 items', () => { + const list = Immutable.List(); + for (let i = 0; i < 100000; i++) { + list.push(i); + } + list.some((item) => item === 50000); + }); + }); }); diff --git a/perf/Map.js b/perf/Map.js index f32bf36e29..b5758c7074 100644 --- a/perf/Map.js +++ b/perf/Map.js @@ -1,13 +1,12 @@ +/* global Immutable */ describe('Map', function () { - describe('builds from an object', function () { - var obj2 = {}; for (var ii = 0; ii < 2; ii++) { obj2['x' + ii] = ii; } - it('of 2', function() { + it('of 2', function () { Immutable.Map(obj2); }); @@ -16,7 +15,7 @@ describe('Map', function () { obj8['x' + ii] = ii; } - it('of 8', function() { + it('of 8', function () { Immutable.Map(obj8); }); @@ -25,7 +24,7 @@ describe('Map', function () { obj32['x' + ii] = ii; } - it('of 32', function() { + it('of 32', function () { Immutable.Map(obj32); }); @@ -34,20 +33,18 @@ describe('Map', function () { obj1024['x' + ii] = ii; } - it('of 1024', function() { + it('of 1024', function () { Immutable.Map(obj1024); }); - }); describe('builds from an array', function () { - var array2 = []; for (var ii = 0; ii < 2; ii++) { array2[ii] = ['x' + ii, ii]; } - it('of 2', function() { + it('of 2', function () { Immutable.Map(array2); }); @@ -56,7 +53,7 @@ describe('Map', function () { array8[ii] = ['x' + ii, ii]; } - it('of 8', function() { + it('of 8', function () { Immutable.Map(array8); }); @@ -65,7 +62,7 @@ describe('Map', function () { array32[ii] = ['x' + ii, ii]; } - it('of 32', function() { + it('of 32', function () { Immutable.Map(array32); }); @@ -74,62 +71,68 @@ describe('Map', function () { array1024[ii] = ['x' + ii, ii]; } - it('of 1024', function() { + it('of 1024', function () { Immutable.Map(array1024); }); - }); describe('builds from a List', function () { - var list2 = Immutable.List().asMutable(); for (var ii = 0; ii < 2; ii++) { - list2 = list2.push( - Immutable.List(['x' + ii, ii]) - ); + list2 = list2.push(Immutable.List(['x' + ii, ii])); } list2 = list2.asImmutable(); - it('of 2', function() { + it('of 2', function () { Immutable.Map(list2); }); var list8 = Immutable.List().asMutable(); for (var ii = 0; ii < 8; ii++) { - list8 = list8.push( - Immutable.List(['x' + ii, ii]) - ); + list8 = list8.push(Immutable.List(['x' + ii, ii])); } list8 = list8.asImmutable(); - it('of 8', function() { + it('of 8', function () { Immutable.Map(list8); }); var list32 = Immutable.List().asMutable(); for (var ii = 0; ii < 32; ii++) { - list32 = list32.push( - Immutable.List(['x' + ii, ii]) - ); + list32 = list32.push(Immutable.List(['x' + ii, ii])); } list32 = list32.asImmutable(); - it('of 32', function() { + it('of 32', function () { Immutable.Map(list32); }); var list1024 = Immutable.List().asMutable(); for (var ii = 0; ii < 1024; ii++) { - list1024 = list1024.push( - Immutable.List(['x' + ii, ii]) - ); + list1024 = list1024.push(Immutable.List(['x' + ii, ii])); } list1024 = list1024.asImmutable(); - it('of 1024', function() { + it('of 1024', function () { Immutable.Map(list1024); }); - }); + describe('merge a map', () => { + [2, 8, 32, 1024].forEach((size) => { + const obj1 = {}; + const obj2 = {}; + for (let ii = 0; ii < size; ii++) { + obj1['k' + ii] = '1_' + ii; + obj2['k' + ii] = '2_' + ii; + } + + const map1 = Immutable.Map(obj1); + const map2 = Immutable.Map(obj2); + + it('of ' + size, () => { + map1.merge(map2); + }); + }); + }); }); diff --git a/perf/Record.js b/perf/Record.js new file mode 100644 index 0000000000..712c077a58 --- /dev/null +++ b/perf/Record.js @@ -0,0 +1,80 @@ +/* global Immutable */ +describe('Record', () => { + describe('builds from an object', () => { + [2, 5, 10, 100, 1000].forEach((size) => { + var defaults = {}; + var values = {}; + for (var ii = 0; ii < size; ii++) { + defaults['x' + ii] = null; + values['x' + ii] = ii; + } + + var Rec = Immutable.Record(defaults); + + it('of ' + size, () => { + Rec(values); + }); + }); + }); + + describe('update random using set()', () => { + [2, 5, 10, 100, 1000].forEach((size) => { + var defaults = {}; + var values = {}; + for (var ii = 0; ii < size; ii++) { + defaults['x' + ii] = null; + values['x' + ii] = ii; + } + + var Rec = Immutable.Record(defaults); + var rec = Rec(values); + + var key = 'x' + Math.floor(size / 2); + + it('of ' + size, () => { + rec.set(key, 999); + }); + }); + }); + + describe('access random using get()', () => { + [2, 5, 10, 100, 1000].forEach((size) => { + var defaults = {}; + var values = {}; + for (var ii = 0; ii < size; ii++) { + defaults['x' + ii] = null; + values['x' + ii] = ii; + } + + var Rec = Immutable.Record(defaults); + var rec = Rec(values); + + var key = 'x' + Math.floor(size / 2); + + it('of ' + size, () => { + rec.get(key); + }); + }); + }); + + describe('access random using property', () => { + [2, 5, 10, 100, 1000].forEach((size) => { + var defaults = {}; + var values = {}; + for (var ii = 0; ii < size; ii++) { + defaults['x' + ii] = null; + values['x' + ii] = ii; + } + + var Rec = Immutable.Record(defaults); + var rec = Rec(values); + + var key = 'x' + Math.floor(size / 2); + + it('of ' + size, () => { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions + rec[key]; + }); + }); + }); +}); diff --git a/perf/toJS.js b/perf/toJS.js new file mode 100644 index 0000000000..d924d332d8 --- /dev/null +++ b/perf/toJS.js @@ -0,0 +1,22 @@ +/* global Immutable */ +describe('toJS', () => { + const array32 = []; + for (let ii = 0; ii < 32; ii++) { + array32[ii] = ii; + } + const list = Immutable.List(array32); + + it('List of 32', () => { + Immutable.toJS(list); + }); + + const obj32 = {}; + for (let ii = 0; ii < 32; ii++) { + obj32[ii] = ii; + } + const map = Immutable.Map(obj32); + + it('Map of 32', () => { + Immutable.toJS(map); + }); +}); diff --git a/resources/COPYRIGHT b/resources/COPYRIGHT deleted file mode 100644 index 54f9e0ac13..0000000000 --- a/resources/COPYRIGHT +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ diff --git a/resources/bench.js b/resources/bench.js deleted file mode 100644 index 10370f2cc7..0000000000 --- a/resources/bench.js +++ /dev/null @@ -1,231 +0,0 @@ -var Benchmark = require('benchmark'); -var child_process = require('child_process'); -var colors = require('colors'); -var fs = require('fs'); -var path = require('path'); -var Promise = require("bluebird"); -var vm = require('vm'); - -var exec = Promise.promisify(child_process.exec); -var readdir = Promise.promisify(fs.readdir); -var readFile = Promise.promisify(fs.readFile); - -var perfDir = path.resolve(__dirname, '../perf/'); - -Promise.all([ - readFile(path.resolve(__dirname, '../dist/immutable.js'), { encoding: 'utf8' }), - exec('git show master:dist/immutable.js') -]).then(function (args) { - var newSrc = args[0]; - var oldSrc = args[1].toString({ encoding: 'utf8' }).slice(0, -1); // wtf, comma? - return newSrc === oldSrc ? [newSrc] : [newSrc, oldSrc]; -}).then(function (sources) { - return sources.map(function (source) { - var sourceExports = {}; - var sourceModule = { exports: sourceExports }; - vm.runInNewContext(source, { - require: require, - module: sourceModule, - exports: sourceExports - }, 'immutable.js'); - return sourceModule.exports; - }); -}).then(function (modules) { - return readdir(perfDir).then(function (filepaths) { - return Promise.all(filepaths.map(function (filepath) { - return readFile(path.resolve(perfDir, filepath)).then(function (source) { - return { - path: filepath, - source: source - }; - }); - })) - }).then(function (sources) { - var tests = {}; - - modules.forEach(function (Immutable, version) { - sources.forEach(function (source) { - var description = []; - var beforeStack = []; - var beforeFn; - var prevBeforeFn; - - function describe(name, fn) { - description.push(name); - beforeStack.push(prevBeforeFn); - prevBeforeFn = beforeFn; - fn(); - beforeFn = prevBeforeFn; - prevBeforeFn = beforeStack.pop(); - description.pop(); - } - - function beforeEach(fn) { - beforeFn = !prevBeforeFn ? fn : function (prevBeforeFn) { - return function () { prevBeforeFn(); fn(); }; - }(prevBeforeFn); - } - - function it(name, test) { - var fullName = description.join(' > ') + ' ' + name; - (tests[fullName] || (tests[fullName] = { - description: fullName, - tests: [] - })).tests[version] = { - before: beforeFn, - test: test - }; - } - - vm.runInNewContext(source.source, { - describe: describe, - it: it, - beforeEach: beforeEach, - console: console, - Immutable: Immutable - }, source.path); - }); - }); - - // Array<{ - // description: String, - // tests: Array<{ - // before: Function, - // test: Function - // }> // one per module, [new,old] or just [new] - // }> - return Object.keys(tests).map(function (key) { return tests[key]; }); - }); -}).then(function (tests) { - var suites = []; - - tests.forEach(function (test) { - var suite = new Benchmark.Suite(test.description, { - onStart: function (event) { - console.log(event.currentTarget.name.bold); - process.stdout.write(' ...running... '.gray); - }, - onComplete: function (event) { - process.stdout.write('\r\x1B[K'); - var stats = Array.prototype.map.call(event.currentTarget, function (target) { - return target.stats; - }); - - - function pad(n, s) { - return Array(Math.max(0, 1 + n - s.length)).join(' ') + s; - } - - function fmt(b) { - return Math.floor(b).toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); - } - - function pct(p) { - return (Math.floor(p * 10000) / 100) + '%'; - } - - var dualRuns = stats.length === 2; - - if (dualRuns) { - - var prevMean = 1 / stats[1].mean; - var prevLow = 1 / (stats[1].mean + stats[1].deviation * 2); - var prevHigh = 1 / (stats[1].mean - stats[1].deviation * 2); - - // console.log( - // (dualRuns ? ' Old: '.bold.gray : ' ') + - // ( - // pad(9, fmt(prevLow)) + ' ' + - // pad(9, fmt(prevMean)) + ' ' + - // pad(9, fmt(prevHigh)) + ' ops/sec' - // ) - // ); - - var prevLowmoe = 1 / (stats[1].mean + stats[1].moe); - var prevHighmoe = 1 / (stats[1].mean - stats[1].moe); - - console.log( - (dualRuns ? ' Old: '.bold.gray : ' ') + - ( - pad(9, fmt(prevLowmoe)) + ' ' + - pad(9, fmt(prevMean)) + ' ' + - pad(9, fmt(prevHighmoe)) + ' ops/sec' - ) - ); - } - - var mean = 1 / stats[0].mean; - var low = 1 / (stats[0].mean + stats[0].deviation * 2); - var high = 1 / (stats[0].mean - stats[0].deviation * 2); - - // console.log( - // (dualRuns ? ' New: '.bold.gray : ' ') + - // ( - // pad(9, fmt(low)) + ' ' + - // pad(9, fmt(mean)) + ' ' + - // pad(9, fmt(high)) + ' ops/sec' - // ) - // ); - - var lowmoe = 1 / (stats[0].mean + stats[0].moe); - var highmoe = 1 / (stats[0].mean - stats[0].moe); - - console.log( - (dualRuns ? ' New: '.bold.gray : ' ') + - ( - pad(9, fmt(lowmoe)) + ' ' + - pad(9, fmt(mean)) + ' ' + - pad(9, fmt(highmoe)) + ' ops/sec' - ) - ); - - if (dualRuns) { - - var diffMean = (mean - prevMean) / prevMean; - - var comparison = event.currentTarget[1].compare(event.currentTarget[0]); - var comparison2 = event.currentTarget[0].compare(event.currentTarget[1]); - console.log(' compare: ' + comparison + ' ' + comparison2); - - console.log(' diff: ' + pct(diffMean)); - - function sq(p) { - return p * p; - } - - var rme = Math.sqrt( - (sq(stats[0].rme / 100) + sq(stats[1].rme / 100)) / 2 - ); - // console.log('rmeN: ' + stats[0].rme); - // console.log('rmeO: ' + stats[1].rme); - console.log(' rme: ' + pct(rme)); - } - - // console.log(stats); - } - }); - - test.tests.forEach(function (run) { - suite.add({ - fn: run.test, - onStart: run.before, - onCycle: run.before - }); - }); - - suites.push(suite); - }); - - var onBenchComplete; - var promise = new Promise(function (_resolve) { - onBenchComplete = _resolve; - }); - - Benchmark.invoke(suites, 'run', { onComplete: onBenchComplete }); - - return onBenchComplete; -}).then(function () { - console.log('all done'); -}).catch(function (error) { - console.log('ugh', error.stack); -}); diff --git a/resources/benchmark.js b/resources/benchmark.js new file mode 100644 index 0000000000..a2e77aa399 --- /dev/null +++ b/resources/benchmark.js @@ -0,0 +1,283 @@ +var Benchmark = require('benchmark'); +var child_process = require('child_process'); +var fs = require('fs'); +var path = require('path'); +var vm = require('vm'); + +function promisify(fn) { + return function () { + return new Promise((resolve, reject) => + fn.apply( + this, + Array.prototype.slice + .call(arguments) + .concat((err, out) => (err ? reject(err) : resolve(out))) + ) + ); + }; +} + +var exec = promisify(child_process.exec); +var readdir = promisify(fs.readdir); +var readFile = promisify(fs.readFile); + +var perfDir = path.resolve(__dirname, '../perf/'); + +Promise.all([ + readFile(path.resolve(__dirname, '../dist/immutable.js'), { + encoding: 'utf8', + }), + exec('git show main:dist/immutable.js'), +]) + .then(function (args) { + var newSrc = args[0]; + var oldSrc = args[1].toString({ encoding: 'utf8' }).slice(0, -1); // wtf, comma? + return newSrc === oldSrc ? [newSrc] : [newSrc, oldSrc]; + }) + .then(function (sources) { + return sources.map(function (source) { + var sourceExports = {}; + var sourceModule = { exports: sourceExports }; + vm.runInNewContext( + source, + { + require: require, + module: sourceModule, + exports: sourceExports, + }, + 'immutable.js' + ); + return sourceModule.exports; + }); + }) + .then(function (modules) { + return readdir(perfDir) + .then(function (filepaths) { + return Promise.all( + filepaths.map(function (filepath) { + return readFile(path.resolve(perfDir, filepath)).then( + function (source) { + return { + path: filepath, + source: source, + }; + } + ); + }) + ); + }) + .then(function (sources) { + var tests = {}; + + modules.forEach(function (Immutable, version) { + sources.forEach(function (source) { + var description = []; + var beforeStack = []; + var beforeFn; + var prevBeforeFn; + + function describe(name, fn) { + description.push(name); + beforeStack.push(prevBeforeFn); + prevBeforeFn = beforeFn; + fn(); + beforeFn = prevBeforeFn; + prevBeforeFn = beforeStack.pop(); + description.pop(); + } + + function beforeEach(fn) { + beforeFn = !prevBeforeFn + ? fn + : (function (prevBeforeFn) { + return function () { + prevBeforeFn(); + fn(); + }; + })(prevBeforeFn); + } + + function it(name, test) { + var fullName = description.join(' > ') + ' ' + name; + ( + tests[fullName] || + (tests[fullName] = { + description: fullName, + tests: [], + }) + ).tests[version] = { + before: beforeFn, + test: test, + }; + } + + vm.runInNewContext( + source.source, + { + describe: describe, + it: it, + beforeEach: beforeEach, + console: console, + Immutable: Immutable, + }, + source.path + ); + }); + }); + + // Array<{ + // description: String, + // tests: Array<{ + // before: Function, + // test: Function + // }> // one per module, [new,old] or just [new] + // }> + return Object.keys(tests).map(function (key) { + return tests[key]; + }); + }); + }) + .then(function (tests) { + var suites = []; + + tests.forEach(function (test) { + var suite = new Benchmark.Suite(test.description, { + onStart: function (event) { + console.log(event.currentTarget.name.bold); + process.stdout.write(' ...running... '.gray); + }, + onComplete: function (event) { + process.stdout.write('\r\x1B[K'); + var stats = Array.prototype.map.call( + event.currentTarget, + function (target) { + return target.stats; + } + ); + + function pad(n, s) { + return Array(Math.max(0, 1 + n - s.length)).join(' ') + s; + } + + function fmt(b) { + return Math.floor(b) + .toString() + .replace(/\B(?=(\d{3})+(?!\d))/g, ','); + } + + function pct(p) { + return Math.floor(p * 10000) / 100 + '%'; + } + + var dualRuns = stats.length === 2; + + if (dualRuns) { + var prevMean = 1 / stats[1].mean; + // var prevLow = 1 / (stats[1].mean + stats[1].deviation * 2); + // var prevHigh = 1 / (stats[1].mean - stats[1].deviation * 2); + + // console.log( + // (dualRuns ? ' Old: '.bold.gray : ' ') + + // ( + // pad(9, fmt(prevLow)) + ' ' + + // pad(9, fmt(prevMean)) + ' ' + + // pad(9, fmt(prevHigh)) + ' ops/sec' + // ) + // ); + + var prevLowmoe = 1 / (stats[1].mean + stats[1].moe); + var prevHighmoe = 1 / (stats[1].mean - stats[1].moe); + + console.log( + (dualRuns ? ' Old: '.bold.gray : ' ') + + (pad(9, fmt(prevLowmoe)) + + ' ' + + pad(9, fmt(prevMean)) + + ' ' + + pad(9, fmt(prevHighmoe)) + + ' ops/sec') + ); + } + + var mean = 1 / stats[0].mean; + // var low = 1 / (stats[0].mean + stats[0].deviation * 2); + // var high = 1 / (stats[0].mean - stats[0].deviation * 2); + + // console.log( + // (dualRuns ? ' New: '.bold.gray : ' ') + + // ( + // pad(9, fmt(low)) + ' ' + + // pad(9, fmt(mean)) + ' ' + + // pad(9, fmt(high)) + ' ops/sec' + // ) + // ); + + var lowmoe = 1 / (stats[0].mean + stats[0].moe); + var highmoe = 1 / (stats[0].mean - stats[0].moe); + + console.log( + (dualRuns ? ' New: '.bold.gray : ' ') + + (pad(9, fmt(lowmoe)) + + ' ' + + pad(9, fmt(mean)) + + ' ' + + pad(9, fmt(highmoe)) + + ' ops/sec') + ); + + if (dualRuns) { + var diffMean = (mean - prevMean) / prevMean; + + var comparison = event.currentTarget[1].compare( + event.currentTarget[0] + ); + var comparison2 = event.currentTarget[0].compare( + event.currentTarget[1] + ); + console.log(' compare: ' + comparison + ' ' + comparison2); + + console.log(' diff: ' + pct(diffMean)); + + function sq(p) { + return p * p; + } + + var rme = Math.sqrt( + (sq(stats[0].rme / 100) + sq(stats[1].rme / 100)) / 2 + ); + // console.log('rmeN: ' + stats[0].rme); + // console.log('rmeO: ' + stats[1].rme); + console.log(' rme: ' + pct(rme)); + } + + // console.log(stats); + }, + }); + + test.tests.forEach(function (run) { + suite.add({ + fn: run.test, + onStart: run.before, + onCycle: run.before, + }); + }); + + suites.push(suite); + }); + + var onBenchComplete; + // eslint-disable-next-line @typescript-eslint/no-unused-vars + var promise = new Promise(function (_resolve) { + onBenchComplete = _resolve; + }); + + Benchmark.invoke(suites, 'run', { onComplete: onBenchComplete }); + + return onBenchComplete; + }) + .then(function () { + console.log('all done'); + }) + .catch(function (error) { + console.log('ugh', error.stack); + }); diff --git a/resources/check-build-output.mjs b/resources/check-build-output.mjs new file mode 100644 index 0000000000..1cfffc5b84 --- /dev/null +++ b/resources/check-build-output.mjs @@ -0,0 +1,45 @@ +import fs from 'node:fs'; +import path from 'node:path'; + +const packageJsonContent = JSON.parse(fs.readFileSync('package.json', 'utf8')); + +// remove "dist/" prefix from the file names +const distPrefix = 'dist'; +const removeDistPrefix = (file) => path.basename(file); + +const expectedFiles = [ + removeDistPrefix(packageJsonContent.main), + removeDistPrefix(packageJsonContent.module), + removeDistPrefix(packageJsonContent.types), + + // extra files that are not in package.json + 'immutable.min.js', + 'immutable.js.flow', +]; + +console.log('expected files: ', expectedFiles); + +const filesInDistDir = fs + .readdirSync(distPrefix) + .filter((file) => !file.startsWith('.')); + +// There should be no extra files in the dist directory and all expected files should be present +const extraFiles = filesInDistDir.filter( + (file) => !expectedFiles.includes(file) +); +if (extraFiles.length > 0) { + console.error('Extra files found in dist directory:', extraFiles); +} + +const missingFiles = expectedFiles.filter( + (file) => !filesInDistDir.includes(file) +); +if (missingFiles.length > 0) { + console.error('Missing files in dist directory:', missingFiles); +} + +if (extraFiles.length > 0 || missingFiles.length > 0) { + process.exit(1); +} + +console.log('All expected files are present in the dist directory.'); diff --git a/resources/check-git-clean.sh b/resources/check-git-clean.sh new file mode 100755 index 0000000000..3ea73552f8 --- /dev/null +++ b/resources/check-git-clean.sh @@ -0,0 +1,13 @@ +#!/bin/bash -e + +if ! git diff --quiet; then echo " + +$(tput setf 4)The CI build resulted in additional changed files. +Typically this is due to not running $(tput smul)npm test$(tput rmul) locally before +submitting a pull request. + +The following changes were found:$(tput sgr0) +"; + + git diff --exit-code; +fi; diff --git a/resources/copyright.mjs b/resources/copyright.mjs new file mode 100644 index 0000000000..7323639f46 --- /dev/null +++ b/resources/copyright.mjs @@ -0,0 +1,8 @@ +import fs from 'fs'; + +const copyright = fs.readFileSync('./LICENSE', 'utf-8'); +const lines = copyright.trim().split('\n'); + +export default `/**\n * @license\n${lines + .map((line) => ` * ${line}`) + .join('\n')}\n */`; diff --git a/resources/declassify.js b/resources/declassify.js deleted file mode 100644 index a5a9dcb4fd..0000000000 --- a/resources/declassify.js +++ /dev/null @@ -1,136 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -var acorn = require('acorn'); -var estraverse = require('estraverse'); -var MagicString = require('magic-string'); - -/** - * ES6 Class transpiler woefully lacking in features. Overwhelming priority to - * produce the smallest reasonable source code. - * - * Clowntown: - * - * * Members are assigned directly to prototype instead of defined as - * properties. - * - * * Class Expressions only work when prefixed by an export declaration - * - */ -function declassify(source) { - if (!/\bclass\b/.test(source)) { - return source; - } - - var body = new MagicString(source); - - var ast = acorn.parse(source, { - ecmaVersion: 6, - locations: true - }); - - var needsCreateClass; - var classInfo; - - estraverse.traverse(ast, { - enter: function (node) { - switch (node.type) { - case 'ExportDeclaration': - var declaration = node.declaration; - if (declaration.type === 'ClassExpression' || - declaration.type === 'ClassDeclaration') { - body.insert( - declaration.start, - node.default ? - declaration.id.name + ';' : - '{' + declaration.id.name + '};' - ); - } - break; - - case 'ClassExpression': - case 'ClassDeclaration': - var className = node.id.name; - - classInfo = { - name: className, - prev: classInfo, - }; - - var classExpr = ''; - - var hasSuper = !!node.superClass; - if (hasSuper) { - needsCreateClass = true; - var superExpr = body.slice(node.superClass.start, node.superClass.end); - classExpr += 'createClass(' + className + ', ' + superExpr + ');'; - } - - var hasConstructor = node.body.body.some(function (method) { - return method.type === 'MethodDefinition' && - method.key.name === 'constructor'; - }); - if (!hasConstructor) { - classExpr += 'function ' + className + '() {}'; - } - - body.replace(node.start, node.body.start, classExpr); - - // remove { } around class body - body.remove(node.body.start, node.body.start + 1); - body.remove(node.body.end - 1, node.body.end); - break; - - case 'MethodDefinition': - if (node.key.name === 'constructor') { - body.replace( - node.key.start, - node.key.end, - 'function ' + classInfo.name - ); - } else { - var methodName = node.key.name; - body.replace( - node.start, - node.key.end, - classInfo.name + (node.static ? '.' : '.prototype.') + - methodName + ' = function' - ); - body.insert(node.end, ';'); - } - break; - - case 'CallExpression': - if ( - (node.callee.type === 'Identifier' && node.callee.name === 'super') || - (node.callee.type === 'MemberExpression' && node.callee.object.name === 'super') - ) { - throw new Error('super not supported'); - } - break; - } - }, - leave: function(node) { - switch (node.type) { - case 'ClassExpression': - case 'ClassDeclaration': - classInfo = classInfo.prev; - break; - } - } - }); - - if (needsCreateClass) { - body.prepend('import createClass from "./utils/createClass"'); - } - - return body.toString(); -} - -module.exports = declassify; diff --git a/resources/dist-stats.mjs b/resources/dist-stats.mjs new file mode 100644 index 0000000000..7c6079db38 --- /dev/null +++ b/resources/dist-stats.mjs @@ -0,0 +1,92 @@ +import fs from 'node:fs/promises'; +import { deflate } from 'zlib'; +import 'colors'; + +const VERIFY_AGAINST_VERSION = '4'; + +const deflateContent = (content) => + new Promise((resolve, reject) => + deflate(content, (error, out) => (error ? reject(error) : resolve(out))) + ); + +const space = (n, s) => + new Array(Math.max(0, 10 + n - (s || '').length)).join(' ') + (s || ''); + +const bytes = (b) => + `${b.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')} bytes`; + +const diff = (n, o) => { + const d = n - o; + return d === 0 ? '' : d < 0 ? ` ${bytes(d)}`.green : ` +${bytes(d)}`.red; +}; + +const percentage = (s, b) => ` ${Math.floor(10000 * (1 - s / b)) / 100}%`.grey; + +let bundlephobaInfoCache; + +async function bundlephobaInfo(key) { + if (!bundlephobaInfoCache) { + try { + const res = await fetch( + `https://bundlephobia.com/api/size?package=immutable@${VERIFY_AGAINST_VERSION}` + ); + + if (res.status !== 200) { + throw new Error( + `Unable to fetch bundlephobia in dist-stats.mjs. Status code is "${res.status}"` + ); + } + + bundlephobaInfoCache = await res.json(); + } catch (err) { + console.error(err.message); + + throw err; + } + } + + return bundlephobaInfoCache[key]; +} + +/** + * + * @param {PromiseFulfilledResult} promise + */ +function promiseNumberValue(promise) { + if (!promise || !promise.value) { + return null; + } + + const value = promise.value; + + return value === null || typeof value === 'number' + ? value + : Number(Buffer.byteLength(value, 'utf8')); +} + +Promise.allSettled([ + fs.readFile('dist/immutable.js'), + fs.readFile('dist/immutable.min.js'), + bundlephobaInfo('size'), + fs.readFile('dist/immutable.min.js').then(deflateContent), + bundlephobaInfo('gzip'), +]).then(([rawNew, minNew, minOld, zipNew, zipOld]) => { + console.log(` Raw: ${space(14, bytes(promiseNumberValue(rawNew)).cyan)}`); + if (minOld.status === 'fulfilled') { + console.log( + ` Min: ${space(14, bytes(promiseNumberValue(minNew)).cyan)}${percentage( + minNew.value, + rawNew.value + )}${space(15, diff(promiseNumberValue(minNew), promiseNumberValue(minOld)))}` + ); + } + + if (zipOld.status === 'fulfilled') { + console.log( + ` Zip: ${space(14, bytes(promiseNumberValue(zipNew)).cyan)}${percentage( + promiseNumberValue(zipNew), + promiseNumberValue(rawNew) + )}${space(15, diff(promiseNumberValue(zipNew), promiseNumberValue(zipOld)))}` + ); + } +}); diff --git a/resources/identity.ai b/resources/identity.ai new file mode 100644 index 0000000000..44a1d29661 --- /dev/null +++ b/resources/identity.ai @@ -0,0 +1,2208 @@ +%PDF-1.5 % +1 0 obj <>/OCGs[5 0 R 6 0 R]>>/Pages 3 0 R/Type/Catalog>> endobj 2 0 obj <>stream + + + + + application/pdf + + + identity + + + Adobe Illustrator CC 2014 (Macintosh) + 2014-10-30T16:19:54-07:00 + 2014-10-30T16:19:54-07:00 + 2014-10-30T16:19:54-07:00 + + + + 256 + 108 + JPEG + /9j/4AAQSkZJRgABAgEASABIAAD/7QAsUGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABAASAAAAAEA AQBIAAAAAQAB/+4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoK DBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxscHx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8f Hx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgAbAEAAwER AAIRAQMRAf/EAaIAAAAHAQEBAQEAAAAAAAAAAAQFAwIGAQAHCAkKCwEAAgIDAQEBAQEAAAAAAAAA AQACAwQFBgcICQoLEAACAQMDAgQCBgcDBAIGAnMBAgMRBAAFIRIxQVEGE2EicYEUMpGhBxWxQiPB UtHhMxZi8CRygvElQzRTkqKyY3PCNUQnk6OzNhdUZHTD0uIIJoMJChgZhJRFRqS0VtNVKBry4/PE 1OT0ZXWFlaW1xdXl9WZ2hpamtsbW5vY3R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo+Ck5SVlpeYmZ qbnJ2en5KjpKWmp6ipqqusra6voRAAICAQIDBQUEBQYECAMDbQEAAhEDBCESMUEFURNhIgZxgZEy obHwFMHR4SNCFVJicvEzJDRDghaSUyWiY7LCB3PSNeJEgxdUkwgJChgZJjZFGidkdFU38qOzwygp 0+PzhJSktMTU5PRldYWVpbXF1eX1RlZmdoaWprbG1ub2R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo +DlJWWl5iZmpucnZ6fkqOkpaanqKmqq6ytrq+v/aAAwDAQACEQMRAD8A7vhYuxV2KuxV2KuxV2Ku xV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2Kux V2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV 2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2 KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2K uxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2Ku xV2KuxV2KuxV2KuxV2KuxV2KpJrfnXytoV2lpq2oR2ly8YlSNw5JQkqG+EHupwgFICm3n7ycl9BY PqkK3dwImhjbkOQnUPEakU+JWBG+NJ4Smup6np+l2Mt9qE621pCAZZnNFFTQfeTTAgBJT+Y3kkWC X51aIWbytAk1HoZEVXZfs12V1OGinh93zCeafqFlqNlDe2My3FpOvOGZDVWGBBFJF/ysjyOZZ4hq 8Je2DGYDmQAhoxqFoae2Giy4Cr2fnryle2F5qFrqUctnYBTeTAPSMPULWq13p2xpHChB+Z/kIwmb 9Mw+mGCFqSfaIJA+z7Y0V4dr2+YWr+af5fswUa1CSTQDjJ3/ANjjwleH3fMJlrPnLyxot5FZ6rqE VpczKHjiflUqWKhtgQBVT1xooAtGavrOmaPYtfancLbWiFVaV6kAsaAbAnrgUC0ntPzK8iXUoih1 u25nYCRjGCT7yBRhorXu+aM1zzl5Y0KaKHVtQjtJZl9SJXDHktaV+EHviAnhRN15g0a10VdbuLpY 9KaOOVbohuPCYqI2oBX4uY7Y0ikmj/NHyBLIsaazCzuQqikm5JoP2caKRH3fMMpwMXYq7FXYq7FX Yq7FXYq7FXYq7FXYq7FXYq7FXYq7FXz7/wA5BD/ncrX/ALZkX/UTNl2Pl8WEuvu/SxbzmUGqoWFR +jdLFabj/Qodxgj0ckkVK/L7yreaPzC1zX9G0zTL9h6WnL+9etTczCoSR6/yx0+kk99pRj3NRlW5 /t/Z1WXlF8kWgAFBrt5QU2oLe27ZEf71tmAMkh/tn61TQvzC13R/LN/oVm/G3vt4p6nlbcv74J/r r08Oo3wmO+7UDtt/Z3/sSbSmU/XKDiv1GYDx+1398JH3s4kHly4D97MPJ4A/LrzxTb9xYfjXIdR7 /wBLKYA/0v8AvAhfJ/lfSNZ8u+Zbi9nlgk0uNLmzWFlUNIIJSA/JWqKqOlMkL5sMsgJcPK5foCh+ WXljSfMutS2mr3M8EEFsbhGhdVJkWVVAbmsgpRvDJEHoGuWSogyP4soHz15gXX/Neo6iG5W88pit W8IIv3cbb9OVORyMRQZ2OR67ft/033PQ/MXmL9O/kXFcyNW6t5YLS7rufVhcLU17svFj88jEVJEj 6SfxzeS3JtxzXifUV5vUJdWXiR+6CIByUqQamvh9JjyHwb8+05A8rl3edUPJlPnhzJpXlEvcLdH9 DN+9B5D4WkATfvHTifcYjr7x97EAGv6sv9w9L83/APkgoP8Atm6X/wATt8Y/W4x+l4/ocnlyPUOO qxXskv1pfq/1SeGONV5inJHjkJ38CMRfD8HKyishF/x7cq57bW+r8qaHYq7FXYq7FXYq7FXYq7FX Yq7FXYq7FXYq7FXYq7FXhf56aHrN/wCbbaWxsZ7qL9HRxmSKNnUMJ5WIJA60OX4gSGucwLsjcd47 2OeZ/LOvT65bD9GXMkDWWmRyMsT8R6dpCsgJA2oQQcYwLbLNAWCRvXUd6/V/ywv7Gy1OaJXvPTkR NLhiq7mNmDO7KvdR8P3nwy84yHBjqozoX069PJTuvLvmF/Jdqg0u69UaxdzND6T8wjwW/FiKdCVI ykQPLyc2eeJkZWN53zCK0n8rrq7j0i4nD2sMqt+lrd6rIDG7cOKn+daD265fHETTgz1UY2B5e4/2 FLfKvknX7u9ntbmyuLOOWznQTyxsqB+JZKkjoWoMqMCT8XJGeMYncfTXMd6GTT/PGm2uoaQlnexw X4ijvYYrf1klEBqnGUBqU/yDv3wGBB5MxljIXZ5Dly5V8NnoPkXydfWXkjzHJfq8d/qEDm3s1oWH CGQRqaV+Ji/TCRKPLqGk5IZJ2T9Mr/HyYZ5X0jzPptrrDrpN6LqawNtahYXqZJZkBPT9mPkfmMdw eXNncJAbi4+Y57/rUtL/AC+80XlpK6Wj2qsPRkiuJPRZ1Uq9eJjOxYA9euIxz/H9qZ6nANjfL+cP +JNfNVstL83p5X1rSjo16LS8a3uIy0MhAnhcKwBAAq6vU7fsjIiJBHe2TyRkJEHb3jnte6DbQ/Nc 9ulgmj3Bi+stcoZLf025uAtDMx2T22/oxhKqr8fJOXPi4zMG9yase/8AnH7r6Jv5p8k67Yaf5dtE tZrxo7Gb6y9sjSqkk8sj8BTb4eYB3wGMiTt1CMebGKs7VLu6iupCIml/M+88pXeiXllevpMVnBHa xPZCL+5uIBGFdV5NRFPfBEerzTk4eHY7VzND/fFJdO07zfYzlrXSJmMswkpPYJKQSezyK5H0ZIRk BVfj5Lky4pSMhLnK+YHP3T/Q+osx0OxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KpDr0cjX iFVJHpj/AIk2Z2lIEfi6rXRJmPchryGQ3KfCePCOv/ACuWY5Cvm1ZoHiHuH3KbWtFcjc7cB9OSE2 Bxc17Qy/o9BxNfWY0/2K4OIcfwZGB8Mf1v0BatrXgTt/OMJmxGLk61t5CzhgVBRt8ZyC4sZ39y1B eRxyRorem9PUoKg06b4TwkglA4wCByKNsLRTZzmQkOBVVHiAaZTln6hTk4MXoNoW1hlCyngxfj8A HjUDLJyGzRigaO26mltMVPRa7EHJGYYDHJWiS5FlPGY29NipBptyB/pkZGPEDbZES4CK2UPTnKBO GwNa5OxdtfDKqpEXltIkFqq/HRCSR0qWJpleOYJLbmxkRiPJUL6k9k8UqH0AihPhp0Zab/LI1ASs c2d5TAgj01+pCwrcIwATuDuK5bIgtEBIdGWZqnfOxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2Kux V2KpbqUbtOpVSRxHT5nMnCRTh6iJMvgpTwyGZfhJHFK/8CMlGQprnA38mntSquR8X8gxE1OKrcYp fqqjia8yafQMeIcS8J4Pi2trXgTt/OMTNRi5LYIJCzAqQCp3wykEQgVoW5RXQK3FvtUFQae+G4nd FSFhFWtuRby8vtEVA+g5VOe4b8WP0lQgimUSURuRWi0HeuTkRs1QiRey1LaYg7UrsQcJmGIxyXIk 4t5EKHi1CDTuDgJFgsgJcJFLPTnKhOG1a9MlY5sOGVVSpcW8ixwqByopqR7muRjIWWzJjIAXVvGt 2jdT6YUBdvAimD03afWY0eSlGs6EAJ37iuSJBa4iQ6J1mG7J2KuxV2KuxV2KuxV2KuxV2KuxV2Ku xV2KuxV2KuxVQnVi4oCdsnEtcwbaZGLDY0oP1YQUEG22gIDEb/y4iSmC3g/pgUNa/wAMb3RRpcsF eJO38wxMkiC1I2JIIIqOuJKBEtcZRVaGh64bC0VWONljavUjpkSd2cY0FNFdQ3wmpFBhJDAAhywy EHt88TIKIlwV+DLxO+NhQDTXCQjjx2rXDYWiueNgFAFaDemAFJiXfvShUg0ptt747LvTSiQdF/DC aQAUTlTc7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FX Yq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXY q7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FWTf7hv+Xf8A4TAyd/uG/wCXf/hMVd/uG/5d/wDhMVd/ uG/5d/8AhMVd/uG/5d/+ExV3+4b/AJd/+ExV3+4b/l3/AOExV3+4b/l3/wCExV3+4b/l3/4TFXf7 hv8Al3/4TFXf7hv+Xf8A4TFXf7hv+Xf/AITFXf7hv+Xf/hMVd/uG/wCXf/hMVd/uG/5d/wDhMVd/ uG/5d/8AhMVd/uG/5d/+ExV3+4b/AJd/+ExV3+4b/l3/AOExV3+4b/l3/wCExV3+4b/l3/4TFXf7 hv8Al3/4TFXf7hv+Xf8A4TFXf7hv+Xf/AITFXf7hv+Xf/hMVd/uG/wCXf/hMVd/uG/5d/wDhMVd/ uG/5d/8AhMVd/uG/5d/+ExV3+4b/AJd/+ExV3+4b/l3/AOExV3+4b/l3/wCExV//2Q== + + + + proof:pdf + uuid:65E6390686CF11DBA6E2D887CEACB407 + xmp.did:5962c3f6-6a0f-4199-90f1-c6dea6f71387 + uuid:15bcb097-31e4-8d46-bdb6-d8c19fdf6524 + + uuid:1abccb90-0c26-4942-b156-fd2eb962e3e1 + xmp.did:58fdc1b8-1448-3a44-9e20-282d8ec1cf95 + uuid:65E6390686CF11DBA6E2D887CEACB407 + proof:pdf + + + + + saved + xmp.iid:5962c3f6-6a0f-4199-90f1-c6dea6f71387 + 2014-10-30T16:19:52-07:00 + Adobe Illustrator CC 2014 (Macintosh) + / + + + + Web + Document + 1 + True + False + + 960.000000 + 560.000000 + Pixels + + + + Cyan + Magenta + Yellow + Black + + + + + + Default Swatch Group + 0 + + + + White + RGB + PROCESS + 255 + 255 + 255 + + + Black + RGB + PROCESS + 0 + 0 + 0 + + + RGB Red + RGB + PROCESS + 255 + 0 + 0 + + + RGB Yellow + RGB + PROCESS + 255 + 255 + 0 + + + RGB Green + RGB + PROCESS + 0 + 255 + 0 + + + RGB Cyan + RGB + PROCESS + 0 + 255 + 255 + + + RGB Blue + RGB + PROCESS + 0 + 0 + 255 + + + RGB Magenta + RGB + PROCESS + 255 + 0 + 255 + + + R=193 G=39 B=45 + RGB + PROCESS + 193 + 39 + 45 + + + R=237 G=28 B=36 + RGB + PROCESS + 237 + 28 + 36 + + + R=241 G=90 B=36 + RGB + PROCESS + 241 + 90 + 36 + + + R=247 G=147 B=30 + RGB + PROCESS + 247 + 147 + 30 + + + R=251 G=176 B=59 + RGB + PROCESS + 251 + 176 + 59 + + + R=252 G=238 B=33 + RGB + PROCESS + 252 + 238 + 33 + + + R=217 G=224 B=33 + RGB + PROCESS + 217 + 224 + 33 + + + R=140 G=198 B=63 + RGB + PROCESS + 140 + 198 + 63 + + + R=57 G=181 B=74 + RGB + PROCESS + 57 + 181 + 74 + + + R=0 G=146 B=69 + RGB + PROCESS + 0 + 146 + 69 + + + R=0 G=104 B=55 + RGB + PROCESS + 0 + 104 + 55 + + + R=34 G=181 B=115 + RGB + PROCESS + 34 + 181 + 115 + + + R=0 G=169 B=157 + RGB + PROCESS + 0 + 169 + 157 + + + R=41 G=171 B=226 + RGB + PROCESS + 41 + 171 + 226 + + + R=0 G=113 B=188 + RGB + PROCESS + 0 + 113 + 188 + + + R=46 G=49 B=146 + RGB + PROCESS + 46 + 49 + 146 + + + R=27 G=20 B=100 + RGB + PROCESS + 27 + 20 + 100 + + + R=102 G=45 B=145 + RGB + PROCESS + 102 + 45 + 145 + + + R=147 G=39 B=143 + RGB + PROCESS + 147 + 39 + 143 + + + R=158 G=0 B=93 + RGB + PROCESS + 158 + 0 + 93 + + + R=212 G=20 B=90 + RGB + PROCESS + 212 + 20 + 90 + + + R=237 G=30 B=121 + RGB + PROCESS + 237 + 30 + 121 + + + R=199 G=178 B=153 + RGB + PROCESS + 199 + 178 + 153 + + + R=153 G=134 B=117 + RGB + PROCESS + 153 + 134 + 117 + + + R=115 G=99 B=87 + RGB + PROCESS + 115 + 99 + 87 + + + R=83 G=71 B=65 + RGB + PROCESS + 83 + 71 + 65 + + + R=198 G=156 B=109 + RGB + PROCESS + 198 + 156 + 109 + + + R=166 G=124 B=82 + RGB + PROCESS + 166 + 124 + 82 + + + R=140 G=98 B=57 + RGB + PROCESS + 140 + 98 + 57 + + + R=117 G=76 B=36 + RGB + PROCESS + 117 + 76 + 36 + + + R=96 G=56 B=19 + RGB + PROCESS + 96 + 56 + 19 + + + R=66 G=33 B=11 + RGB + PROCESS + 66 + 33 + 11 + + + + + + Grays + 1 + + + + R=0 G=0 B=0 + RGB + PROCESS + 0 + 0 + 0 + + + R=26 G=26 B=26 + RGB + PROCESS + 26 + 26 + 26 + + + R=51 G=51 B=51 + RGB + PROCESS + 51 + 51 + 51 + + + R=77 G=77 B=77 + RGB + PROCESS + 77 + 77 + 77 + + + R=102 G=102 B=102 + RGB + PROCESS + 102 + 102 + 102 + + + R=128 G=128 B=128 + RGB + PROCESS + 128 + 128 + 128 + + + R=153 G=153 B=153 + RGB + PROCESS + 153 + 153 + 153 + + + R=179 G=179 B=179 + RGB + PROCESS + 179 + 179 + 179 + + + R=204 G=204 B=204 + RGB + PROCESS + 204 + 204 + 204 + + + R=230 G=230 B=230 + RGB + PROCESS + 230 + 230 + 230 + + + R=242 G=242 B=242 + RGB + PROCESS + 242 + 242 + 242 + + + + + + Web Color Group + 1 + + + + R=63 G=169 B=245 + RGB + PROCESS + 63 + 169 + 245 + + + R=122 G=201 B=67 + RGB + PROCESS + 122 + 201 + 67 + + + R=255 G=147 B=30 + RGB + PROCESS + 255 + 147 + 30 + + + R=255 G=29 B=37 + RGB + PROCESS + 255 + 29 + 37 + + + R=255 G=123 B=172 + RGB + PROCESS + 255 + 123 + 172 + + + R=189 G=204 B=212 + RGB + PROCESS + 189 + 204 + 212 + + + + + + + Adobe PDF library 11.00 + + + + + + + + + + + + + + + + + + + + + + + + + endstream endobj 3 0 obj <> endobj 8 0 obj <>/Resources<>/ExtGState<>/Properties<>/XObject<>>>/Thumb 20 0 R/TrimBox[0.0 0.0 960.0 560.0]/Type/Page>> endobj 9 0 obj <>stream +HWˎGWTNWlcƮuAf֣[dRAdUV& ߞgg~zl.Ot8Rߜo7WӥlK&`)vJe_s=wkhs1Krބm)\_/|z9r ,>X Goc 4n}Sy06Uelm۫&~ؙcǰrqB!Mgpjm`s0|iFl #lk[XÜ IBaMoI}MU 5l]zYv,ܗyƭvZ@IR9qQTx4m^/xHsa#wFq^<ˎsUC{zެMx8aYcj=hCbiԉl?7 +̰ @fxi4uB̰8YMU/ff!UQRV 3xnEXܝ;%çw|61գx48ndqaa|6%U^0-~/B#t;6 ؊JjC͡`8q! +}*D^u&4@~E pvef YglDvE3gFłpF;*b44C6]'Z#Ġx^xl$9s|ʚbE^0HCkQ*AO +T*':iIVݷoHiUiU_@G!(V=+':i*GѪvҪVkhg緣U*ZV,6/`>]?nl+~ ۊ[&z,WOuVnl+b[ɝld['*u>!ۺ;d[RT߈PV#E`d_Vwpe< tz1_sҐ@+ ]rRM\fPI +[k5|:j[ǛleTiݩ3A$MT^~ԚdvuuuUჳht.[> endobj 20 0 obj <>stream +8;Z\u5n8N$$j;VR-9:UhT)'<$0@%\#iB&n#M&p=M`b5lXt>9a/<+@KdI>\';9_Ob?VVFp#qBr +6`>t+Opn?\"-,&u;UKhmW#jb?),s)kWS;mu=QT4(Es1c*Hs+$IogkoB7r@q*WQF\3 +W#eMkTStuRhFE':++9f0-UJ(^KFgHU\Km4:!!e-hiW~> endstream endobj 22 0 obj [/Indexed/DeviceRGB 255 23 0 R] endobj 23 0 obj <>stream +8;X]O>EqN@%''O_@%e@?J;%+8(9e>X=MR6S?i^YgA3=].HDXF.R$lIL@"pJ+EP(%0 +b]6ajmNZn*!='OQZeQ^Y*,=]?C.B+\Ulg9dhD*"iC[;*=3`oP1[!S^)?1)IZ4dup` +E1r!/,*0[*9.aFIR2&b-C#soRZ7Dl%MLY\.?d>Mn +6%Q2oYfNRF$$+ON<+]RUJmC0InDZ4OTs0S!saG>GGKUlQ*Q?45:CI&4J'_2j$XKrcYp0n+Xl_nU*O( +l[$6Nn+Z_Nq0]s7hs]`XX1nZ8&94a\~> endstream endobj 17 0 obj <>/ExtGState<>>>/Subtype/Form>>stream +/CS0 cs 0.427 0.737 0.859 scn +/GS0 gs +271.996 378.559 13.56 -40.02 re +f +q 1 0 0 1 289.6611 378.5591 cm +0 0 m +10.56 0 l +21 -15.36 l +31.38 0 l +41.94 0 l +41.94 -40.02 l +29.16 -40.02 l +29.16 -25.62 l +21 -37.62 l +12.78 -25.62 l +12.78 -40.02 l +0 -40.02 l +h +f +Q +q 1 0 0 1 335.707 378.5591 cm +0 0 m +10.56 0 l +21 -15.36 l +31.38 0 l +41.94 0 l +41.94 -40.02 l +29.16 -40.02 l +29.16 -25.62 l +21 -37.62 l +12.78 -25.62 l +12.78 -40.02 l +0 -40.02 l +h +f +Q +q 1 0 0 1 397.1504 337.519 cm +0 0 m +-2.52 0 -4.8 0.321 -6.84 0.96 c +-8.88 1.6 -10.62 2.56 -12.06 3.84 c +-13.5 5.12 -14.61 6.74 -15.39 8.7 c +-16.17 10.659 -16.56 12.96 -16.56 15.6 c +-16.56 41.04 l +-3.78 41.04 l +-3.78 16.14 l +-3.78 14.739 -3.49 13.67 -2.91 12.93 c +-2.331 12.189 -1.36 11.82 0 11.82 c +1.359 11.82 2.33 12.189 2.91 12.93 c +3.489 13.67 3.78 14.739 3.78 16.14 c +3.78 41.04 l +16.62 41.04 l +16.62 15.6 l +16.62 12.96 16.23 10.659 15.45 8.7 c +14.67 6.74 13.55 5.12 12.09 3.84 c +10.629 2.56 8.88 1.6 6.84 0.96 c +4.8 0.321 2.52 0 0 0 c +f +Q +q 1 0 0 1 423.2202 368.0591 cm +0 0 m +-7.38 0 l +-7.38 10.5 l +20.58 10.5 l +20.58 0 l +13.2 0 l +13.2 -29.52 l +0 -29.52 l +h +f +Q +q 1 0 0 1 460.8916 350.959 cm +0 0 m +-2.7 7.02 l +-5.4 0 l +h +-7.5 27.6 m +2.1 27.6 l +17.28 -12.42 l +4.68 -12.42 l +3.36 -8.82 l +-8.76 -8.82 l +-10.08 -12.42 l +-22.68 -12.42 l +h +f +Q +q 1 0 0 1 493.0215 347.959 cm +0 0 m +3.039 0 4.56 1.16 4.56 3.48 c +4.56 5.799 3.039 6.96 0 6.96 c +-1.44 6.96 l +-1.44 0 l +h +3 18.42 m +3 20.259 1.999 21.18 0 21.18 c +-1.44 21.18 l +-1.44 15.66 l +0 15.66 l +1.999 15.66 3 16.58 3 18.42 c +-13.801 30.6 m +1.859 30.6 l +3.859 30.6 5.689 30.37 7.35 29.91 c +9.009 29.45 10.43 28.77 11.609 27.87 c +12.789 26.97 13.71 25.85 14.369 24.51 c +15.029 23.169 15.359 21.6 15.359 19.8 c +15.359 18.52 15.199 17.43 14.88 16.53 c +14.559 15.63 14.22 14.88 13.859 14.28 c +13.419 13.56 12.919 12.96 12.359 12.48 c +13.239 11.919 14.04 11.199 14.76 10.32 c +15.359 9.56 15.909 8.6 16.409 7.44 c +16.909 6.279 17.159 4.86 17.159 3.18 c +17.159 1.26 16.819 -0.48 16.14 -2.04 c +15.459 -3.6 14.489 -4.93 13.229 -6.03 c +11.97 -7.13 10.43 -7.971 8.609 -8.55 c +6.789 -9.13 4.76 -9.42 2.52 -9.42 c +-13.801 -9.42 l +h +f +Q +q 1 0 0 1 513.6592 378.5591 cm +0 0 m +13.32 0 l +13.32 -29.52 l +24.36 -29.52 l +24.36 -40.02 l +0 -40.02 l +h +f +Q +q 1 0 0 1 539.9697 378.5591 cm +0 0 m +23.58 0 l +23.58 -10.5 l +12.78 -10.5 l +12.78 -14.94 l +23.4 -14.94 l +23.4 -24.9 l +12.78 -24.9 l +12.78 -29.52 l +24 -29.52 l +24 -40.02 l +0 -40.02 l +h +f +Q + endstream endobj 18 0 obj <>/ExtGState<>>>/Subtype/Form>>stream +/CS0 cs 0.427 0.737 0.859 scn +/GS0 gs +271.996 398.559 13.56 -40.02 re +f +q 1 0 0 1 289.6611 398.5591 cm +0 0 m +10.56 0 l +21 -15.36 l +31.38 0 l +41.94 0 l +41.94 -40.02 l +29.16 -40.02 l +29.16 -25.62 l +21 -37.62 l +12.78 -25.62 l +12.78 -40.02 l +0 -40.02 l +h +f +Q +q 1 0 0 1 335.707 398.5591 cm +0 0 m +10.56 0 l +21 -15.36 l +31.38 0 l +41.94 0 l +41.94 -40.02 l +29.16 -40.02 l +29.16 -25.62 l +21 -37.62 l +12.78 -25.62 l +12.78 -40.02 l +0 -40.02 l +h +f +Q +q 1 0 0 1 397.1504 357.519 cm +0 0 m +-2.52 0 -4.8 0.321 -6.84 0.96 c +-8.88 1.6 -10.62 2.56 -12.06 3.84 c +-13.5 5.12 -14.61 6.74 -15.39 8.7 c +-16.17 10.659 -16.56 12.96 -16.56 15.6 c +-16.56 41.04 l +-3.78 41.04 l +-3.78 16.14 l +-3.78 14.739 -3.49 13.67 -2.91 12.93 c +-2.331 12.189 -1.36 11.82 0 11.82 c +1.359 11.82 2.33 12.189 2.91 12.93 c +3.489 13.67 3.78 14.739 3.78 16.14 c +3.78 41.04 l +16.62 41.04 l +16.62 15.6 l +16.62 12.96 16.23 10.659 15.45 8.7 c +14.67 6.74 13.55 5.12 12.09 3.84 c +10.629 2.56 8.88 1.6 6.84 0.96 c +4.8 0.321 2.52 0 0 0 c +f +Q +q 1 0 0 1 423.2202 388.0591 cm +0 0 m +-7.38 0 l +-7.38 10.5 l +20.58 10.5 l +20.58 0 l +13.2 0 l +13.2 -29.52 l +0 -29.52 l +h +f +Q +q 1 0 0 1 460.8916 370.959 cm +0 0 m +-2.7 7.02 l +-5.4 0 l +h +-7.5 27.6 m +2.1 27.6 l +17.28 -12.42 l +4.68 -12.42 l +3.36 -8.82 l +-8.76 -8.82 l +-10.08 -12.42 l +-22.68 -12.42 l +h +f +Q +q 1 0 0 1 493.0215 367.959 cm +0 0 m +3.039 0 4.56 1.16 4.56 3.48 c +4.56 5.799 3.039 6.96 0 6.96 c +-1.44 6.96 l +-1.44 0 l +h +3 18.42 m +3 20.259 1.999 21.18 0 21.18 c +-1.44 21.18 l +-1.44 15.66 l +0 15.66 l +1.999 15.66 3 16.58 3 18.42 c +-13.801 30.6 m +1.859 30.6 l +3.859 30.6 5.689 30.37 7.35 29.91 c +9.009 29.45 10.43 28.77 11.609 27.87 c +12.789 26.97 13.71 25.85 14.369 24.51 c +15.029 23.169 15.359 21.6 15.359 19.8 c +15.359 18.52 15.199 17.43 14.88 16.53 c +14.559 15.63 14.22 14.88 13.859 14.28 c +13.419 13.56 12.919 12.96 12.359 12.48 c +13.239 11.919 14.04 11.199 14.76 10.32 c +15.359 9.56 15.909 8.6 16.409 7.44 c +16.909 6.279 17.159 4.86 17.159 3.18 c +17.159 1.26 16.819 -0.48 16.14 -2.04 c +15.459 -3.6 14.489 -4.93 13.229 -6.03 c +11.97 -7.13 10.43 -7.971 8.609 -8.55 c +6.789 -9.13 4.76 -9.42 2.52 -9.42 c +-13.801 -9.42 l +h +f +Q +q 1 0 0 1 513.6592 398.5591 cm +0 0 m +13.32 0 l +13.32 -29.52 l +24.36 -29.52 l +24.36 -40.02 l +0 -40.02 l +h +f +Q +q 1 0 0 1 539.9697 398.5591 cm +0 0 m +23.58 0 l +23.58 -10.5 l +12.78 -10.5 l +12.78 -14.94 l +23.4 -14.94 l +23.4 -24.9 l +12.78 -24.9 l +12.78 -29.52 l +24 -29.52 l +24 -40.02 l +0 -40.02 l +h +f +Q + endstream endobj 19 0 obj <>/ExtGState<>>>/Subtype/Form>>stream +/CS0 cs 0.427 0.737 0.859 scn +/GS0 gs +271.996 418.559 13.56 -40.02 re +f +q 1 0 0 1 289.6611 418.5591 cm +0 0 m +10.56 0 l +21 -15.36 l +31.38 0 l +41.94 0 l +41.94 -40.02 l +29.16 -40.02 l +29.16 -25.62 l +21 -37.62 l +12.78 -25.62 l +12.78 -40.02 l +0 -40.02 l +h +f +Q +q 1 0 0 1 335.707 418.5591 cm +0 0 m +10.56 0 l +21 -15.36 l +31.38 0 l +41.94 0 l +41.94 -40.02 l +29.16 -40.02 l +29.16 -25.62 l +21 -37.62 l +12.78 -25.62 l +12.78 -40.02 l +0 -40.02 l +h +f +Q +q 1 0 0 1 397.1504 377.519 cm +0 0 m +-2.52 0 -4.8 0.321 -6.84 0.96 c +-8.88 1.6 -10.62 2.56 -12.06 3.84 c +-13.5 5.12 -14.61 6.74 -15.39 8.7 c +-16.17 10.659 -16.56 12.96 -16.56 15.6 c +-16.56 41.04 l +-3.78 41.04 l +-3.78 16.14 l +-3.78 14.739 -3.49 13.67 -2.91 12.93 c +-2.331 12.189 -1.36 11.82 0 11.82 c +1.359 11.82 2.33 12.189 2.91 12.93 c +3.489 13.67 3.78 14.739 3.78 16.14 c +3.78 41.04 l +16.62 41.04 l +16.62 15.6 l +16.62 12.96 16.23 10.659 15.45 8.7 c +14.67 6.74 13.55 5.12 12.09 3.84 c +10.629 2.56 8.88 1.6 6.84 0.96 c +4.8 0.321 2.52 0 0 0 c +f +Q +q 1 0 0 1 423.2202 408.0591 cm +0 0 m +-7.38 0 l +-7.38 10.5 l +20.58 10.5 l +20.58 0 l +13.2 0 l +13.2 -29.52 l +0 -29.52 l +h +f +Q +q 1 0 0 1 460.8916 390.959 cm +0 0 m +-2.7 7.02 l +-5.4 0 l +h +-7.5 27.6 m +2.1 27.6 l +17.28 -12.42 l +4.68 -12.42 l +3.36 -8.82 l +-8.76 -8.82 l +-10.08 -12.42 l +-22.68 -12.42 l +h +f +Q +q 1 0 0 1 493.0215 387.959 cm +0 0 m +3.039 0 4.56 1.16 4.56 3.48 c +4.56 5.799 3.039 6.96 0 6.96 c +-1.44 6.96 l +-1.44 0 l +h +3 18.42 m +3 20.259 1.999 21.18 0 21.18 c +-1.44 21.18 l +-1.44 15.66 l +0 15.66 l +1.999 15.66 3 16.58 3 18.42 c +-13.801 30.6 m +1.859 30.6 l +3.859 30.6 5.689 30.37 7.35 29.91 c +9.009 29.45 10.43 28.77 11.609 27.87 c +12.789 26.97 13.71 25.85 14.369 24.51 c +15.029 23.169 15.359 21.6 15.359 19.8 c +15.359 18.52 15.199 17.43 14.88 16.53 c +14.559 15.63 14.22 14.88 13.859 14.28 c +13.419 13.56 12.919 12.96 12.359 12.48 c +13.239 11.919 14.04 11.199 14.76 10.32 c +15.359 9.56 15.909 8.6 16.409 7.44 c +16.909 6.279 17.159 4.86 17.159 3.18 c +17.159 1.26 16.819 -0.48 16.14 -2.04 c +15.459 -3.6 14.489 -4.93 13.229 -6.03 c +11.97 -7.13 10.43 -7.971 8.609 -8.55 c +6.789 -9.13 4.76 -9.42 2.52 -9.42 c +-13.801 -9.42 l +h +f +Q +q 1 0 0 1 513.6592 418.5591 cm +0 0 m +13.32 0 l +13.32 -29.52 l +24.36 -29.52 l +24.36 -40.02 l +0 -40.02 l +h +f +Q +q 1 0 0 1 539.9697 418.5591 cm +0 0 m +23.58 0 l +23.58 -10.5 l +12.78 -10.5 l +12.78 -14.94 l +23.4 -14.94 l +23.4 -24.9 l +12.78 -24.9 l +12.78 -29.52 l +24 -29.52 l +24 -40.02 l +0 -40.02 l +h +f +Q + endstream endobj 26 0 obj <> endobj 13 0 obj <> endobj 12 0 obj [/ICCBased 27 0 R] endobj 27 0 obj <>stream +HyTSwoɞc [5laQIBHADED2mtFOE.c}08׎8GNg9w߽'0 ֠Jb  + 2y.-;!KZ ^i"L0- @8(r;q7Ly&Qq4j|9 +V)gB0iW8#8wթ8_٥ʨQQj@&A)/g>'Kt;\ ӥ$պFZUn(4T%)뫔0C&Zi8bxEB;Pӓ̹A om?W= +x-[0}y)7ta>jT7@tܛ`q2ʀ&6ZLĄ?_yxg)˔zçLU*uSkSeO4?׸c. R ߁-25 S>ӣVd`rn~Y&+`;A4 A9=-tl`;~p Gp| [`L`< "A YA+Cb(R,*T2B- +ꇆnQt}MA0alSx k&^>0|>_',G!"F$H:R!zFQd?r 9\A&G rQ hE]a4zBgE#H *B=0HIpp0MxJ$D1D, VĭKĻYdE"EI2EBGt4MzNr!YK ?%_&#(0J:EAiQ(()ӔWT6U@P+!~mD eԴ!hӦh/']B/ҏӿ?a0nhF!X8܌kc&5S6lIa2cKMA!E#ƒdV(kel }}Cq9 +N')].uJr + wG xR^[oƜchg`>b$*~ :Eb~,m,-ݖ,Y¬*6X[ݱF=3뭷Y~dó ti zf6~`{v.Ng#{}}jc1X6fm;'_9 r:8q:˜O:ϸ8uJqnv=MmR 4 +n3ܣkGݯz=[==<=GTB(/S,]6*-W:#7*e^YDY}UjAyT`#D="b{ų+ʯ:!kJ4Gmt}uC%K7YVfFY .=b?SƕƩȺy چ k5%4m7lqlioZlG+Zz͹mzy]?uuw|"űNwW&e֥ﺱ*|j5kyݭǯg^ykEklD_p߶7Dmo꿻1ml{Mś nLl<9O[$h՛BdҞ@iءG&vVǥ8nRĩ7u\ЭD-u`ֲK³8%yhYѹJº;.! +zpg_XQKFAǿ=ȼ:ɹ8ʷ6˶5̵5͵6ζ7ϸ9к<Ѿ?DINU\dlvۀ܊ݖޢ)߯6DScs 2F[p(@Xr4Pm8Ww)Km endstream endobj 25 0 obj <> endobj 24 0 obj <> endobj 5 0 obj <> endobj 6 0 obj <> endobj 30 0 obj [/View/Design] endobj 31 0 obj <>>> endobj 28 0 obj [/View/Design] endobj 29 0 obj <>>> endobj 14 0 obj <> endobj 15 0 obj <> endobj 16 0 obj <> endobj 11 0 obj <> endobj 32 0 obj <> endobj 33 0 obj <>stream +%!PS-Adobe-3.0 %%Creator: Adobe Illustrator(R) 17.0 %%AI8_CreatorVersion: 18.0.0 %%For: (Lee Byron) () %%Title: (Untitled-1) %%CreationDate: 10/30/14 4:19 PM %%Canvassize: 16383 %%BoundingBox: 83 -268 726 -4 %%HiResBoundingBox: 83.2057291666688 -267.358072916666 725.64453125 -4.17317708333303 %%DocumentProcessColors: Cyan Magenta Yellow Black %AI5_FileFormat 13.0 %AI12_BuildNumber: 18 %AI3_ColorUsage: Color %AI7_ImageSettings: 0 %%RGBProcessColor: 0 0 0 ([Registration]) %AI3_Cropmarks: 0 -560 960 0 %AI3_TemplateBox: 480.5 -280.5 480.5 -280.5 %AI3_TileBox: 102 -568 836 8 %AI3_DocumentPreview: None %AI5_ArtSize: 14400 14400 %AI5_RulerUnits: 6 %AI9_ColorModel: 1 %AI5_ArtFlags: 0 0 0 1 0 0 1 0 0 %AI5_TargetResolution: 800 %AI5_NumLayers: 2 %AI9_OpenToView: 57.5 -4.5 2 1192 711 18 0 0 121 293 0 0 0 1 1 0 1 1 0 1 %AI5_OpenViewLayers: 73 %%PageOrigin:80 -580 %AI7_GridSettings: 72 8 72 8 1 0 0.800000011920929 0.800000011920929 0.800000011920929 0.899999976158142 0.899999976158142 0.899999976158142 %AI9_Flatten: 1 %AI12_CMSettings: 00.MS %%EndComments endstream endobj 34 0 obj <>stream +%%BoundingBox: 83 -268 726 -4 %%HiResBoundingBox: 83.2057291666688 -267.358072916666 725.64453125 -4.17317708333303 %AI7_Thumbnail: 128 52 8 %%BeginData: 12290 Hex Bytes %0000330000660000990000CC0033000033330033660033990033CC0033FF %0066000066330066660066990066CC0066FF009900009933009966009999 %0099CC0099FF00CC0000CC3300CC6600CC9900CCCC00CCFF00FF3300FF66 %00FF9900FFCC3300003300333300663300993300CC3300FF333300333333 %3333663333993333CC3333FF3366003366333366663366993366CC3366FF %3399003399333399663399993399CC3399FF33CC0033CC3333CC6633CC99 %33CCCC33CCFF33FF0033FF3333FF6633FF9933FFCC33FFFF660000660033 %6600666600996600CC6600FF6633006633336633666633996633CC6633FF %6666006666336666666666996666CC6666FF669900669933669966669999 %6699CC6699FF66CC0066CC3366CC6666CC9966CCCC66CCFF66FF0066FF33 %66FF6666FF9966FFCC66FFFF9900009900339900669900999900CC9900FF %9933009933339933669933999933CC9933FF996600996633996666996699 %9966CC9966FF9999009999339999669999999999CC9999FF99CC0099CC33 %99CC6699CC9999CCCC99CCFF99FF0099FF3399FF6699FF9999FFCC99FFFF %CC0000CC0033CC0066CC0099CC00CCCC00FFCC3300CC3333CC3366CC3399 %CC33CCCC33FFCC6600CC6633CC6666CC6699CC66CCCC66FFCC9900CC9933 %CC9966CC9999CC99CCCC99FFCCCC00CCCC33CCCC66CCCC99CCCCCCCCCCFF %CCFF00CCFF33CCFF66CCFF99CCFFCCCCFFFFFF0033FF0066FF0099FF00CC %FF3300FF3333FF3366FF3399FF33CCFF33FFFF6600FF6633FF6666FF6699 %FF66CCFF66FFFF9900FF9933FF9966FF9999FF99CCFF99FFFFCC00FFCC33 %FFCC66FFCC99FFCCCCFFCCFFFFFF33FFFF66FFFF99FFFFCC110000001100 %000011111111220000002200000022222222440000004400000044444444 %550000005500000055555555770000007700000077777777880000008800 %000088888888AA000000AA000000AAAAAAAABB000000BB000000BBBBBBBB %DD000000DD000000DDDDDDDDEE000000EE000000EEEEEEEE0000000000FF %00FF0000FFFFFF0000FF00FFFFFF00FFFFFF %524C45FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8 %AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8 %AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8AFA8FFA8AFA8FFA8AFA8FF %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FF %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFFD81A8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFFD04A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AF %A8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8 %A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AF %A8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8 %A8AFA8A8A8AFA8A8A8AFA8A8A8AFFFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8 %FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8 %AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8 %FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8 %AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFFD81A8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8 %A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AF %A8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8 %A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AF %A8A8A8AFA8A8A8AFA8A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8 %AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8 %FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8 %AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8 %FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFFD81A8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFFD04A8 %AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8 %AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8 %AFA8A8A8AFFFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FF %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FF %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8AFFD81A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8 %AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8 %AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FF %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FF %A8AFA8FFA8AFA8FFFD81A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFFD04A8AFA8A8A8AFA8A8A8AF %A8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8FFA8A8 %A8FFA8A8A8FFA8A8A8FFA8A8A8AFA8CAA8FFA8A8A8FFA8A9A8FFA8CBA8FF %A8A8A8FFA8A8A8FFA8CAA8FFA8A8A8FFA8A8A8FFA8CBA8FFA8A8A8AFA8A8 %A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFFFA8AFA8 %FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8 %AFA8FF7D5252A877527DFFA8FF52527D7D4C7DA8FFA87D527D765252CB76 %52767D5277525252FF7D5252FFA8A85277527D7DFFA2524CA8AFA8527752 %5276FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8 %FFA8AFFD26A87D0027525221277DFF5227007D522700A1AE7D0027275200 %4CA852004C272727280027A85221277DFF7DFD05277DA1002752FFA82821 %270028A8AFFD1EA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF5928277D524C2753A1284B4C595327 %5228A828522752524C4CCB524C4C7D522E27537DA82752277DFFA8275252 %5227537D4C277DFFA9284C2E7D7DFFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8A8AFA8A8A8AFA8A8A8AFA8A8A8AF %A8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A87D272777522728 %27282728277D5227274C272827284C522752A8522752FF7D00277DFF5227 %272827A87D282752272753A8272753FFA8282752527DA8AFA8A8A8AFA8A8 %A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8AFA8FFA8AFA8 %FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8 %FF5928277D5252274C272E274C53532728275227282752524C4CFF524C28 %AF5928277D8452272E27287DA8274C275227597D4C277DFFAF284C27274C %FFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8 %FFFD26A87D00275352272827280528277D5228272727282727275227287D %52272860592727535A2727282E27527D2827592E27277D272752CA7E5227 %2E527DFD20A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FF5928277D524C5253277D284C597D275252 %285352275352282752272828FF7D28277E524C4B4C4B52277D284C4C5227 %527D524B52277D2852275252FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFFD04A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA87D0027775200525A5959 %27217D4C272784528427272884FD05277EA87D0027524C27525353272727 %4C274B27287DA1004B27274C52274B214CA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFFFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FF845A59A8 %7E5A59858484597E848459848485607E59848485597D598484A97E7E597E %7D7E5A85847E7DA8597E597E5AAFA87E59847DA8597E595A7DFFA8AFA8FF %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFFD26A8A9 %6085848560845A845A855AA9848560845A84608584845A85A8855A848484 %6085848560855A845A85A8855A8584845AA9608584FFA8845A858484FD20 %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FF848560AF848584858485608584856085848584856085 %84858485608584FF848560A984858485608584A9848584856085A8856085 %60858485848584FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8 %AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8A95A8484855A84848584845AA984 %845A8584845A8584A85A855A845AA9A8A85A8584845A8584845A8584845A %85608484A960845A8584845A855A84A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8AFA8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8FF848584A984A9 %848584A9848584A9848584A9848584A9848584AF848584AF848584A9A885 %84A9848584AF848584A984A9A8A984A9A8FF848584A984FFA8FFA8AFA8FF %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFFD27A87E8484 %847EFD0684A8FD04847EFD0484A8FD0784A8848484A8FD0684A88484A884 %8484A87E8484A8A8FD0484FD21A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA88584A984A984A984 %AF8485A8AF84A984A9A8A984AFA88584A9848584FFA88584AF848584A984 %8584AF848584A984A9A8A9848584AF848584A984FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFFD04A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A884 %85A8A884A9A8A884A984A8848584A884A9848484A98484848584A8A8A984 %8484A984A884A9848484A9848484A9A8A884A9848484A9848484A9A8A8A8 %AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFFF %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8A9A8AFA8A9A8AFA8A9A8AFA8A9A8AFA8A9A8AFA8A9A8AF %A8AFA8AFA8FFA8AFA8A9A8AFA8A9A8AFA8AFA8AFA8A9A8AFA8A9A8AFA8AF %A8AFA8A9A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FF %A8AFA8FFA8AFFD27A884A8A8A884A884A8A8A884A8A8A884A884A884A8A8 %A884A8A8A884A8A8A884A8A8A884A8A8A884A8A8A884A8A8A884A884A884 %A8A8A884FD23A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8A9A8FFA8A9A8FFA8AFA8AFA8AFA8AF %A8AFA8AFA8AFA8AFA8A9A8AFA8FFA8AFA8AFA8AFA8AFA8AFA8AFA8AFA8A9 %A8AFA8AFA8AFA8AFA8AFA8A9A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8 %A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8A9A8A8A8A9A8A8A8 %AFA8A884A9A8A8A8AFA8A8A8A9A8A8A8A9A8A8A8AFA8A884A9A8A884A9A8 %A8A8A9A8A884A9A8A8A8A9A8A8A8A9A8A884A9A8A8A8AFA8A8A8AFA8A8A8 %AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8AFA8FFA8AFA8FF %A8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8AFA8FFA8FFA8FFA8FFA8FFA8AF %A8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FF %FD81A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FF %A8FFA8FFA8FFA8FFA8FFFD04A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AF %A8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8 %A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AF %A8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8 %A8AFA8A8A8AFA8A8A8AFA8A8A8AFA8A8A8AFFFA8AFA8FFA8AFA8FFA8AFA8 %FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8 %AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8 %FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8 %AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFA8FFA8AFFD81A8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8FFA8 %FFA8FFA8FFFD81A8FFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8 %FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFF %FFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8 %FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFFFFA8FFFF %FFA8FFFFFFA8FFFFFFA8FFFFFFA8FD81FFFF %%EndData endstream endobj 35 0 obj <>stream +%AI12_CompressedDataxeu&0 5ZǼ[ N\rK B:+,e;+e"'"^= 2␇u/n>}/gson?.O?9>㛏o?>y{~#*[oֆSO zﯾg_ͻ?]?<K]:"]31&/䳏ŴxN!Do]D7gg޽g>׏_|q_tWNy'Լ:ߏo߾0G7o1xs+>|gO'?~+_}O#^.QC)??鍬&v矽o1ӌVbeB1gԶxigcGӚNu<ǿ=|]k|߽%~4$o~WRmWke'_ wcgYxr'kgwb9gOn3&ͻ_v1ͧfw*?y3n~'dcǏc;f7ܿg\/xఱaϽ}'[~|uZOAj'{%/?ջ}?L| " ȅ?z?;܇ǓVgo=+uݿ?}[m|{ݫ'|o50=kl^#6Ct?`S/|oG쫖w˧lx^}3(OX:?^"ًv<6G2jcޞ|9޾}>G9_*olݽO~7>_||| ͨkz+6˫7vw7zN Z?,Op l/~`nSw^}w {wߓOp;'SN_&خMZJٖb]ٔ m-wro&n`)~S®D-mBoٔyWne)K;݄?;-۩)aSK,fS.Zh-߭gج꺶(ӲaȺ-(Zv;oVRž,ˬr﷫9\k7c]/WkYܭM-Z{)w*zYuXtڒu@S]#m-wRky`i'/]K+Ћ'/fy;#Le0I8Hc'!r6-Pn%܅tSq7o}|0 ]R`7(x`- Vs~S6vS.r+s+W6%oJڕ)aS`N= [~s+Z&)72oJٕ)iStvo)f-mʧv۟Mh[׬~˂6_炙Ns720u +w<-۲>kfDg㦖YJ%KIZ_+SIڳEM-R ZPEIo#m-e.^E'ʂpLLl,dެԽLE&LQޕ/hndYFdD=&t%P@̈́tYѻ+70 z(7Vqo@6˜A@#dq?`#a.s)oŃ[\!wK.9hGonq?`ab/ 3} &3acoq1(&R0<. kq2r! n.}]qRp3%qGyUv(U^/b%]ڊZ+i:7p)wpqҍtо~l[ Æ+I"6f:JrGo +璷Pnz*m&@nvY9r + Lý 2qanY fK!ܝӢg]-*ֺ 7• +KhG9c\d/tAX/Fq4g*+R=:hOE:iƇ񲰿Lى8=ZN2Ti?ʐd=E@[8})i' +݄;wte"451s)a(~(ԟi'OܖI[;,"iVaai#kI/,He(q/,G|P6|ϑ~۽hU.w(ՔMIQ,ܔOUlnǻEߟơӻ==MOk^T(VݐĪc;wFUr]edUlvih42 +ãA~39ݷ~FGQi\ }/\%T H?#8n!4A" #@Q9,rr%[HA$ RHB* Qr* =TeF΍[-=0w*NVbҔ3+"@i׵ᱚ&U-$дavDu ;eG#wq$,m;$kOp#22q||JZj^-Q5nua"H/nWn+iWSNWv*Jr˴Z0ǦM=R5ycWJZ]SfQ7?Ug)E\?U^VeZ5KvT7f?]Xhi*LUh6fi?Znthzlz4D7-l$J#-i)\h~@UuL6thBQkTgCi.ùNk1;R $M9$ϑiёiK%6i؜kd`<{:_IӢeUeag&pzic=T,mQ e6E^XQh$iN{/Zzrbm7n[ZoXw#n!- b5`IҦ0Td8RA5*h73fAJSX+Sg}['ɇm?y36 rkyH<&a*Dd6F{/"HQ.ljQ 8S]?Ny\ޚ=bU~Y}nfU̹ߨN%}uùcWBUamu:ٺ''oON׉PASH;}ZD¡dC&b(b`bu5Yi;jb/*sUjkՄBW2?+u%Y '+zUVCJnf_l\'cU'_(2i4lZĎp#ETRw$"ª sTbUuZEnK, 7$k w;!c˥o"6YvY ߊ͗\ݙWW\ ;~p#^Y`Q良W^{cbLBA}.`Ӌ]}\ocq Nބۻpu;{/Ǔ2>ն{_?~y8=~-GT(Ҡ"`T+ʴx>7lg|R-Ozٛe>TYY:ٻSݾIuL\چu͍2.O",W(^Q^l~924}9!,4#AiEq%,g %#s%υja3'g:<<r=?39I;yo|0vYdBŞ#K<$K1FmcAǢBH=Qh=W; +Ѷfk2tPACU}02x/4>/ϕ=ӧ{A1e9qoY8ejoUI'O>sUcb FcWTՎb&<9WDU\g`o =9er>h*_Iig=~Jhgnnyms^\j/e Ro:SnhBL\$#kq  +kX&,^kz\u>l/ƴ7T7rǥ2 M/ޅA[lH8$fqOTqƅYv5.b5)% Wjk@|G\X9->L䥔,岖)n 7nݬMrXJܕte>(7SrDY̺ӱOPj<m1F~Ke=vUP^hũ +19f)~uݘkFlgVf 5Rn{xq{Qƺ7NlnNq#.uėيE 4\ETp햩ڭ(-uјc't*-2ߌAchn%jjfLsF dkN*Wn&k5uNi6l;⳦2I1/6N^gf[`:[t z5{^r}>nc[4}ok|>\,"MUZEi/C7V_[{:AIUޞȽbw +\vqZUo"[`qF؈DO7ϼZḔJ 6J~-[yWsHrMW~$t_onQ]/ 4v%|"74o|u4$ybGL}$WaPMӢݪD6]ա;eZDh޴u}tB]kt@/]đ_5U'z&9s5faNXգxo$^#qHj+v{WYQceϗ:UѪ>KNRlC4hI١K*VgZSEt7U/MJUH~٧ۃkѫ-j>OU7 赠>qUS7sO91w$LζPqĝ$D}G=hݻW=~zSd>}zS {Ef٠{ +sP*n޻:NjWkηɴ8{c* 5/p 㥨#OxO|: d;ۻp5c?ӿ}@D ô}I? xc!>[z9pn9?@4\>YFkc)6>FqG]u$/~)P 3/~"gATYT{,LwbEyTlm-LgT58GBs'Ӵ2ݘ.'VM>g﹟ENMJYZNZVTo"๫NP۲0V}Yt-+%}^T2]*_L_:e^^~“4/-TD9='|G!:S|X|Y T{k: 47샘C*H&V%Q5~OKVz⪢h*jQ!,gݣ{ꝣ"sظ+8 sh)S_̗H|vGH}N),\2ٴvƇc'o ŶKt`1 d)ڳDEg"J|8'=b^èٻ9|o|?;8:t $ww["PnZnzm<#+ l .眍K§HF*`x'N?isĬT/4ggp.FWl X_<q`WA޺O(OY|ǏaVl Ë}u{ o5Ss}6GrpDoqx{q}%wSUa SyҺSqɾ;G{ztFM|ԙax$nBIW{QݷbdXw'z=WYL~_+V,QLIia}-+49r0iąˆcEq"9mkKKޤTZҷ}|^}dH'ȍʾ ߃R~xZ)k{" ތ[rx|vAXl<ƲzuZܠ ٸ_m_Ə|aSz[ KdH>F'> + mTpue*״V6^/wM`W 9P&k-JӭQI hi+]PW7Yȫhӽ%X!3l#yfQ={tqw0(^bcl'IJw޳y#4u1_χ3l%}q@.O؊x ML;5>b p),Jq tD[G6##iyռs]Vg 6oaF{l9WEs sYݻ:n:j0r.$~cQnŐo] ,wk,ZGJGV1h<<$7^/?klä2.)_"F#x/G6-mC+dm=wK>Y XMרO+2;Yƀ{Rc9]"Bᘬ0wBpɀD^23_uӨT ڈ|ˏlՍJ!4ccK|7$ɹ'@A#`T`rU8r(8󍄻p$ۅKWVjI.ExPd\_y !3OUsh}f5k6oŒmm&|RcbncH)171Og}YyZߡj};IM/Wq fʸ nrn+Lߒ"T<ʦF 8Qԅ@RbEIo9QщAMF;cgXPKJ8,[PƊ37[ +ޠ\so|RЬ['-w}[PUpb+b'p;RZefy:Yִ$J{eήr@5JۚVl1S*G\82o7"k{O?{L- \"n/iF,wBj-UT3|/>-\K[tjg)gEwMr~Xkɴh +٬[Szu^)b-c +JӐH~[͎Csߤ+ÕR%iAFae/l䜣)Ӛ)KE$ZôOB5fvIco7 c&vlWE콷b0JsEOӕ̳JD&Z*f5%\8{}OFFxd4;C^~1Jim3#K0K!X!TO5UFу63&Q阚g$' Kr7]ϳjn6j82v{|NJrRm8eeLf8 m; X\lKz07A+GsK~NaG)㧸>sOXFXS$-▛E{EI&Y㭩.)+Kz5A^KKޒwwwBwg;{foG!+SWcUW8]ytt67 W܅^];,]dm#gqPu;䥷eӋ2-VܔBuN>7GgX֙[I=硿r5'xw|۱o>>#ȭ5xfviVoiRnIаo!x_a&ffs= 6 e&!J.4} ZHܫ; wl|e씆Qkh,+V,~ )5qᾦ#A>jn,&lL*u 6kRE[k3VF`# Vیml2<K̰OPMSfAx~fl6t%+uxdEݚJV uہLtׯA7z=N_?Z.E Iԭ)p]Ni([!JE0{19}IE39}IM^tqzVO[᧭Vi+\(֡ ߕ |Ûw߼/~۷?|5{wo/^A<'h) L#;ozoO'|/?})'Y(k-Nuvn +8lrL̩Bː7lt.?[{6`gXb9{,.fČi;0@xD!YL)fǴ|8Іlitl63(UF _r[/c\> iق6 $3iŒy 'Y2)g osg@ .O.K qƋ&;}%Vgs @"PilM^MJ VO +X1=X~׉Kə1xYC:3ma= %س\ Zg YC,}l6 .E†*z9Hes{5I:֣nq2{AxD tDaSvI|=r֦dR!*0Xl׃G; qkO6 3_ _8Jexl Q~MLv HDs\(A7Ufĥq +񜊯s.SLXU[BQ̌}:p0>@| cþpʬt9أQo5Fw6*@|Xp"9|a N`z03f`J8oBŬb-q8qKbI8*&R{ͮs[м 6 ;2dE#c=׭dCRyt{'<,D~_gG89DM?+a#Dg2';ux +6e hV; zo;p"MP"0=N3Xp n$|9#APr- +23CިLOZę\'"LӁ +|7`yjwt`qsz4ȠR Md.qO+ޱEIi@  vgGuE5gspxa;go@JJ_قV3:0ĦK=%syCG*uoua.HKE<bw06S1=7rc-RDyJ2و[X]HsFLN+]N˷IXsy/D|6tjv!DőՒ V|Bҝ IsT)F=fɓ'iO 5%gm-᦯gJ)0P83Dc(~}'S@ZQa9![$>|}XY[]&d?ٵ٨cW·YC pgb" O w&S'D)5{ڻDB?!t=Gڤñ-wj~]^PSNXJe_4;-I Џu /'~N[zR>6GBvqgAw#i ݲ "=-Z +ZipOɯ%:F I6Fɒ "K6{%Rzѱ{"Dv"rH\hEja;s<%-È8Hfxٻ(R3I9Z"օ޻^ѐy@7A;^|DYd(@\▃@zusKVtΐ"Gh΃I >RFH+P8vm=Y ipΈr쁿d\$Gb8 W&:y bLT})G>9Urh28+invv;\fe٘itS{ }. .bcB=NǾN2͔ZO<y:vΙtp+39鯐)΃&9 L+l WXq9bs3:0xp:rBTav++'-"B^Wm-31܍-ߜ; 6bs[qd{{({Z;8DGCCЃ~:Gσ -W:tHD P*qeލl\lG ; Uf +!O )MnA؞);zwC[{'҃ aDcӵ'."u6dX:jK[x\txL.n&iR87+D7,wo~ylR_=fqyx臮_|'|W$p|\sA'gWӌzj_Mv9<& Cyl?6"CsQ*ǯ>ݫ֋QN=s{ MYn_fss'˒{#b悡U3 ^3*vD4&[{X2~F^@%lUDb/aM +NM;{`olt̖.`,Ѩ= [@l +Ї'1G@}`d1 $h΁a%{k<*#تWɋUT/8£ԫ-"T*uuSYc28Ҥ4PzFGƁqf~5*"|L!֋݃WN@F2y*7Ap45Y&@$)&*el\$p#nţ~(pYwӮ]Y|Y/(+Ϥ% n6}ya^<>?+#Y$0r02T;gTaťb0W8;u3I<+^ LHcT/;qx bADF{ +5,-h'EA sCQ` ^(Ji$3|+_ӈ{%$81!3gǭ(X( %m9gZfd@-V3A+ +/$^h,CIC+:SZQ͆6q,NE VSעQnn~:+8`KďY3ЭշbD`-.@7g+&@zEB +,%w'Ka, U=f:L9kU$HKԠ( #fUԪ2ij^ +Mo&+DhI(\3Qi5<@SL:h1 MSR DJh^wh\tZ o*{")|#pX9Q3o8If +Z=k8b$Q+UY^x&mu0ׁbÈ:A2֌--@:>h+ %5J9]W@Qn.t(EXd#+)u #j_]TdTSW38FW8W*q\&(V@f!E\GWkb%XЖ`w4} /fpꧢ>>I"tl?֘Ts*Oi5K;Xql%1ԫ "%(ӥBo[!PmkFn9#v7~s(V1eF2ށ +:!Wz2|Y:]$KR`uF` fP"0* },aiටkp=9[Éw-b8$f'387^H7gbgy@h <9`^k&f觟a(Ϭ +"eA5 cK>;n5Wg y DV”N̉AI} U ͐ƅYư{ȪK .%L)P+'ujh̎BڏtJv|>av3DUqڪȦS!CN #kjXpj10=& T3`"|1бOJ|d*҉)F,9 Z#-.')ΰgqxNYW-~qz-:ѴF -ƽ8tZ|Q9#$d['VoۧQ[T0"ucOUq{JW%T3NWuzn:-7jZU ҏR9Hߢia2O|3 rlG!܉-ۋ: px̙"=B- +A?:{} +21eL!du?NjxE3vS2O0gdňw~td6[AFhR;b> U~`u SŦRSܳA.:f:@ }ߊԈQ}vC!ta +=0gWh HzDkJr1up$ JLnfz%mQWPĥ_o<h 6M\ɋl'nhƍ_1S]mtf: W=tJ$' [TN5 Gt9CL=d<0%g 8CSEqj{p9Fk'Df~*t=L\N Vd/8<=u |\7tr KOF 0DSMmaDXEu܆l^eJYLcG9xD&A[=Yty?cq"ֹxg<k74+ęKE'+4}ގmRwE7n}ЪhSC SA@@Կ0P[E-ك!К 6a po}1DSu=FĮ9 Y-袀NP{6'upotqcZja,>HjiH7z6[x݊!A+A `s@ @DKS1+#z13 e~ Ϯгʱ* 1@bD XxF7`D L1 p!HĀ7D PzHD;Ćpf!b!>!aft%b;l ѐlb  x0t8:TC(.rhÀpHp!10  =!xC;8`7DF1Zu Cb8 c7=8A8aп!03 Uڲ;|C VBl a,\աa(hgq[5QBߨ~nǑР{ +isq }-v@w{n ~WDy*ev06"tm[O V<Փq_lF3żṙq -i򡕦FuZ3-u`?l+mWԡ5cվ$58ɼ3P>ĭ1$[fq,Cڝܵ +_F5>Kb]2ԵhR\77C?cyn~HqS.V2ͣJ5ammlED]5XPO4#L3 ׃m +UQwo\9CdWeeAĂ;, +!bfq + +.@aae4m²,gq#,(zy@ݺfuFBwF@va]fM1VbDwh`W7ޭ*c쯵.β){.fN8L2 +SY+0k}Nk}[,tϹ:wϺx~1 uZi챵R 3@Zgrz,*}F+ L<ɥJw}.G"|,TcF+skeF +C lůrT]A`Dr5z\)sNzU9B:T5P%R<9N7Ax`~ޔHW(#PT< PtIiĂ*n(+ 0$02/ Zف)I690L|8qI]%BY;>f86Z+;`92@u\64*+ZC(AH%GHJg#Vq*{ިP_@&K+GKe6D&BSkDwsD _"&~cZ6ZA T,eHܢe2 }_צSU[v?%Z+;ݬ(Xy(H/ߢvY*xg}NCh}[,Ϲ6wmrik +@R٣~+x@‚t6?U鬕{1ggyfkst?⨱ +cÀFH?SGQX`+qW0Gb` +Ɨ[?Z*$۵(ksOǛO?Yջ <z׶wo><~{s??|xoH3B4ӯ__\/}\6\ D_~_O}Zп/z~Ϳ?|D[t +7O,5ShDMe?e~> )s{_oN?S"H,OV[z}Su{vy޼n?[3/~+jʂB4};O(c]#5V+Fk>ũ*(~ y#ogclk)+J&4 +f`E +ZT:УRS%@3W$OGGQWN#!;*vR$dK2^;z+xR1g^Ds&WT YӃ29Z%CiX2㫠pVt +ffoҙƸ~&w?8fe]|md*f_+[&LR0!/̝l'6ސP:TTd@ʼc"gB] +9*˸6gJ"܍ZzTL%4G`bD}L%y*$+J&:vK?^AT .*m>GRW9E!e?"Њ +2WV|Kؤys $t"i-5$'Ce>D/#d>fL7#Ad(Je:LڨDSC1)E| +D`:^!f Tm44DF+tJj'QE gC!cZaViQQ-WR,TDc9iGi +ĚҲ/y]i ÀGԊ4т"h ɳ`KZ%M5XSNhjʤ$KQ +} )fMy|E BjHXX[DŽ0$N0ѢPn:q*Ac #&dxlse&] +&#"UqI cJEҐ9KȯjA=NxGh @4b#AM'bË 21Lì>. N(RK&Dm@& +iʚK]a7ީ cV. 7n&qëΌ4ׄꂖK"=`l|J>0ht$ܙ@(IH1њĀ-)I}Y"E%Na3UTHƷ^A3RQP^LEQDmE Z*xn;\uqdz ߜNyS/FQy y4B!1!-&QuDbiɊdBуZw,j<Й@*MDb+IWjK ť.ѕP ^1N*5ӕx*jEh&In!JEjnauxy0i=ue`v.Aɸ-AI/(~1W!q$*HUd j s\9HX" +U4ӠYI*J 'F5]@H$ߢTseѲ7*J_F;ůPȏT&N@Tٓis޺'{wy "7I"0T%VY5f'*s6<&39ўm:EEc5N!>3>G3)j +CkRƁ P" `T9 TJw&L+;+A$ሉ[R?hJ [:9N:܀Kf%Tܪ 0"1%8X!D)k~Br7cIl5;+WrL#tgIYQيYAq%$.\G<~N {ŬwCePGD) +LlŸ1’$',l$0s0zU +-t٣F,$Ӄ5^J]Ł,F^=xdr^fB$W26Cd{&,|j _ ,0{c(\7D`4,W_0 +s%B+:qް輻=Kޞ&*'/C.Jً\"DLZ*gg8H\;~~ne3ٙmYL4R9g +\UصءYT|>T~>T*Y,8 7^\ÝZVݝ<+m7C&[e쯡ިMF誡i;R HHPUh^LÎ"bDo\Vs &p-H>(?SLxR!jG3ɐz_J$~0^8PnuA4`VK뤾5It8cwLO4 +kp@@c*管G8cRJ)V`G+۪?\d[EaQ)QB73Όy B!YT+,$ժqu։x^b*ap$d.Dh>KwrSvHe(i}f(4;SV2[^T# sfeU@SYAv!Tm*P"ege/e}UDj!rǡTT +((!Ͱ~Գx)&=uB ŔHҴȇT +H)AL7K$$}+ND%dV g^eƄߒc&+ 䥻9K0[Vdpf&dSWʥ!Y'F_dl'RhsH5̄`2B$s3$6Q>$܆P8|!= +IEOlaϴRvg *t-+dD| n]ښ1w81/$R`i-qE8+eTe[eSukћtJnab 3n_JצzV4t +ŵȐ6` #_%/0< `5 R=gNfK`QUVr+PƉ"p4ar :1Q*.NVK) +yCgś:5>ws)M\P>K>'Ü/՜u-׃(ee]v|%cYD\|zn#I.iRǨ:, KǜGS"L#CiqITQ1QfjXG(;;L$-.ݐbvPz%Շ +Q6dFHĥ̔E0RM\Zu ܤ ULrly*0pRkETU:CN jXEQ/x rbR I!N!as?VvHbs΁N(LӰC8JGARps#)fԊ; +5!b?î6]l2Ĭ Hdff T7'Y2ydVW:*=IHyt 뢹rτq_=*7 ~&\jYVP0ⓖE +j/Pj݉2Lxzt?Psi&OI,)D$ؓw +jS R4(̬No/8'0 |ɪ\ж  Yތ de;:$53iS^γn5I`nDT.I5S}#hYפf^T #)[ ,%̡'-u0P\C<$0L3I܀\- 㙵UV@% [4nQ.qfg 1m1d敕Up^$"-m6k?QYtĢC $ ,ҏW$.z ԊTj5, " 2 %#)X5CII>ga0.mJR]rԸZQ|w5{iîb]nx#Е4..4RMKi>G*S$|K â%(!7*3ЃQs&v ]fh*W#\EʙZ <$z>. &2=āVz(LfC~ +KViܒ<5@@gɆ#y]PE,#(V,.ߴ5cK9)?B!}̠j"O&T5;Ss O[,'=@vhRJs(Ѣ`@Y\O~RеI:{LT $qN"Ġ| +V0$s$5Zq?fWv&;ӻ[e=gP-\*AV|YLf\238dk?oDXr82Ռ~Zq&nMDt 0ng=ܞq) l  {Fn^ +4Zc[,kl\bI+(5Sgw!9~qpT40c/[FbʞaRE7kg~D8ࡉ1`V aKb%J*c9dм(=L N7"Lbu9%6W`_ +2Ar+Pj#؂\͍i&YS~IY6e mCۨjk!atZ=x9[m5{z`fyv>C',|du2M JOjߑfI b಴^˥ǐ%0~VjA`Xl_nZCu$ (f_Ŝr}A'V e쳄mgB+ |%v1_#NjJم10tfW +'-L#!<؍IMMΪn0ǟ` cu + n-K#!!?FT 4ISiAKXZ^!TztAwJ6:7~:*GCb!1; 8[]>mS*|)겍@ .(W <:; :զ3 +h8qML(=\2)@xYȫ3{!n ؿ? +mD=ߞ+#QZ)N,czA-\7t6lN B{7qes P)|ïMCcK-8>4 34Lh=^Q HW,7)ӣ3?P8 +!FRd% Hi&v * r*Y6zELS "XG}v `ͿMA7R-̫{f4-?BEf/3~bpGhvcPS|]rߘd 2J9|J6 +m!Dr< K9o)ζ !~H㓃6-$ж|PN *>q<QRpQU?9/amK,?hca&ť6htKwO- G +U!|j l_p$7G:j'Rdq! U~~־ Em;np A*&<8'cQiTr[LmG@^J).bf_yXz|+ǞaV'%Sf'\<]1)fv=%LVe%wb$T*돐Cʉ뱉|^@r|,9Ff g*;7;v-n9,Vl(Z5420 2( νD͗8Q)XE4}<ZM7Jh]5y曲71RddYl=yEpw_L!;!N?P Gk6H~)H$(Ңa~=ЋorUO _7t~o }\vS)uIMaSw }҆߇ORޞ @1Bʰ'p sZ/B٦jgDʀ-Lu/?5JPx"CT Ld8|>24и(9LR*f]=4`?Ĺ#eւk$5j {aym&sCEݵSVyE~jGYM3 sJ'K*&WnLÞ6US!G`YU̔+,m26IɄ$'\KJwghәnR,+-=Q +W)Æ -ʪtZ 9)]7R^w_gۿ2jes"e7jsFTR $ +cCĪaTܐ bF4KyyKjg_<]ذб1cT3.ђ#vw RGŠH!؍ipҢ9Rqc |ĆA:dנ2qT2ꬮReF332'r¶Dt#V#xJuK:)D}+|Г»#%fFL*g +k| soq..?Ct +5 (0:7.A1@z!s=Pg.3 rJ+("ҝN)?" r|5(L^m86Զy(elP8@(mh^-p]8D@R0'CH_A5x{[['\sp$_6E0Mh/R z1ݸs#Zq&Qcb#.xAG +a9"< Ў%TߗmmmW9Ց9 +333b1'沣v-ڛS5-FOD49L͹9'ײca+@Ͷ%2! A2Krdռ. DhIP%/IxAE#f-ץK[0AݑIs]eZmtjF^ b$*v* Gkx үB&W4LUsb%ADl`q.p}h,hje'1O NNL ^ځv,pn\%N<'RNq.Z睨9 K1puQb"&%}t녑f PPiᙎx^^#"%ǩnہp*ĽRi:#עa:iTdq>6 ͆P@gCOcG_Pj:-TLH%&yo$3ha ~̘e/&Kynq%s-d̿D'@rafl&QCɑFQ:X/5_kt~ )%'f6+MngO=|N VO:- d@s ݬ((y~M%b/\kږ9D;i sۛF^\#%k29'RF j&ǒe N\bu§JcYmG|\ nC]euEiT +~ k="C\Qcwݣ/4Z*Qt )!A! +~Ap1U!JRu=֧w/jHbM* =j)wPEƝN;Jc=wx`OGIMގmV v4֤%e BZ*  $خF<C?w,Gՠ:md} 攝UDΟYA, +Q]pe6T猳ݥ9Fَ1<2#@&?ci܁"dz6UyxFb* l(+g!8"3!-:UIeӑ@ǡwXh0Q=UԂ dX|=VV[sfwÜrG! s})c KlP#c!L[ƆbbÜ4_~@ar8A +G|$gӡEeKcd2}(!+=8p|z,8~* +=El"3Lszm%ǦtoUZre\b'(ЀF{û"Fq)n7T^CcEDf=NWc.{k7D3B4˜^G׼.] 2 9I~毼LIY-O!z7OCkBJ#B_<a?ef3Tq^5C M;#m/_m_d +l4_(t,TrHj>j{/TD/8CpN-WԂf. 2m3mЉLR,Iu .Ioh)A/ޔ|0t7ev?JŏkG؊FuCI@-'Q"28z҄cEqb&גAe I8^h,S<&|< Q|x4˜g@Z湾i_([e1pA}K(ΈcI@ 2?0w0`Jf@lkb,ô[V"rw +. X +2+Ѐ'<%)Kq+Uۚ)Nhbe(2&Ͱ΢ċd-UQhx,TsC#ZDcy-9Pրy~c(Gn?FUTI!Vj!p.fei7Q #1ʘ82Yq>p>e86V'ܬ- gX #fy|ߥ0/zXiW'}~Xv] +LNPBJ덺}+L/S8P +T߳ S.p,FYzmȴht7gFW^u}fj*!@mq6I/=SlN(0ɆEPNؚB:jح(KB){Վ}zJVMNJS~xm!)1@8Rէ)`7}G^($CI-$`4_f7q|U}B9wp/: +9'`V X1)؈R)`WIbHP-`394pW[S٘1B"#$;x\}b3h:s3)vYҍ恘R9w]V[/}U;Rn,ȍ"s ) dǠXm|L`&uCgnk%u&Y%cjU(&z 9a]e|Y(-@FBC .0ء6%Y׾^ޞ[Mi>2|/U"{?wr'ǯO0?g/?ÿ^?_$6p'3*L0$тP;`[U-FP]&5Y˷`X05,ol@q׿bu!>9f"=*`cJ԰ ۋ2G86{!8rE:iDe?匴8:OYWleq8Egd',;C+N(*.P +& 2at.Mb6AUqڗ{cW{$4AǷ=,u_p}gEDt/dҷ}R~&Q!]!e3)smMO*HO=mD綗3 ϾUlԾ]mhgsi{$}8WpV5#'=%^N&t V?͖vN! ,2}wEM9\@-C5ߠބ"7\)ַ!8$'KWX쿋BDvUc}w"]Tnkoƅ}gy Fޅ}*ÿ;9zvS .M@K:mJMS羽?]: 5!(Nܨnn֟"ǸJ\=ʼnpVW)қO59*T5(mO͖t&xk6f&ABcQSxzPs)ܣm= BvgCOZ,Em V0n0Ho7iX&d<"i.o^bc,b6캽kfr~ZBArv#mA/MfV_vz<7s"`b{:(l'g>šo"qҶmH֜4hIG̐Xu͝y91S&O>Z-]opk[f'|dl˻2 aF//#oʘlsrs/p{$0 ]!PM/cօRvi/++L4v@FܶXcIaij&enL.en ><}xt0Ƕqe>!j閭YýH]f Fʅk=/>m4#); c ,|Cѷ0hXŤ!!7+aNC"J|&}O8ȹY0QUGUZ߬C%jYx[3*:p|{i0~e,_rLO9_ƾ~dxSH-^jȅi/[ڧW/+ +nۢXV̋r͐߶s'Sz +U4-]Sa{1rW%;y[r78fȄ=t t QFEX&`7.)roK\qn^pYo@4]n~^8&mnSoK[f67˔7p%`Wb#J̿jOr,~b};%ϿI۔,K{hoSZ@{^g^@V_^|ʶ=yDo#@KVCF{Tr9q,C%>*ف'|=kt q,S$=?gõ -+GZJYCVypA!)$,rnwܖZ-V(u̱GsXtM>si'^8?;r\|[Px6JG̟i'#ZA/j#ۈx3sf*bˈ6U2>g願L䟍hMT-~kCz;ޜhM73ȊɉVt-oÉքeo#ګb.~Eآ^.m7;αNe7Kcqz3e/\A)kF +*>OYn Q3L?z^oagΑ5jqV+ +jez_ =ɪGrjá.) :im'yM%fQY!mUz3sNo![^tL6ԕ$ԕSp;EmSWÒJ)U 86CdoSWaeI6uAg|3@>]]i"jȁW]]m%7WWJ )ػl{WlT@Gbդ?|^Ӕ )꧌9秬&-<1Jpyy1ΓCJ/&Ttk>4͇9nWwxͫArfJ "}Bjsۼ|# *ja!v~=$(M4֚5ct~FHNp;5YLJC ZBf;@ +6^Иiļy۝}_B<#1nX2`-Pn{::U oX$fCR/,`=HbIoV6 +i rbJ߬`J9ʩ_^jj6dL_էbPL*bN?<`yt>(ov؛,0Ƴ(K #}{S: ^鈆[JO#֟^qP'+[U+onX?UCSuWOO^`zao_Ʃ_}h٤kQz{adQ/a9o/:suq?ާ|l< ȺN*?t`TXHTg5EzV>$۽k+o,o`@۪+Ӡ |IǒvgS{!mmCk8POQǸMGٚz^-|a1ꡜngQ>2ŋ@POoQp}.-TA0TDTcW4ޒ4Hjmf)%<7K4(!l۱+=Rߌ*9ÑZJ@B&QGb'kQ."Zz38|{NWi0dLF &{pYXO |JSFEdG*R3c(*3\˦q[PR,+թ9~@r, OHt)ݮX%0?ᤸ&aA5z;qڛ#:' +#oy7qK68}3"k2}#^HO Fs`Yi"`m֋h;.gPzWD2W{3zVSg)Bȁ]rDc:;2A@QiS"Щ1KE^ +,v "Z}W\/-۵bEmZ۫<~ OBTV8,gB]z CHV;3AUճ╇:!u/l|3" F&gɆt}%7iDH$ڡmDH4sрп*NC|}2 AU>aۀP2(ErԘAc4Y)ur ۀpFBK8\!n%JbԽ /׿%VS4VnTw6i2HrjF,,i k$d Lllk1e?]"%;&A@눟 Oo$=xLk9.$ >9a"I$,:3/Ap%G#ЭQ6V;V f $vϹ?ח%=)uv.OO@뤓T޿M}4RM?M" \e pNԝ6R}ňn!%_!Nk7$ja7k@#rV2ݡ4o#@/ߧ9׏+e( LSU :,(CKξs>"omp8%Kvt +V- + Ш?~vAkvAQِ]N4 v9]כ9!YGNb@(Kfhg]ކL Y`}r}fYy2 Cwu&.z*7[mHP 7@Jc + `<=IHGߊ*xt; D7o`Yo?'e\dA!ԗޟ" kx +Gq]thrSsHyQt)uuw7?}(L in?ʷ5e9i`7l Jއv•!e~ מ|D,2i`nEvkYΧ(Z(qݾm_E~Kž~zE+U97?52a)or펷m ǎ">qqf@Qt1:5h%φw""%{ ewZi1JGv4+mo//@$o۞~ +~SQ n{}OO?H@Z3cIzT۔+^߫ijCΠcx{ C[Ǜ$ #ԿZ[gol +8OJRަ~C +@Y?Ϥ^~ZrXzL'J.?X9?`뛕Nn*o+?̭L;o/?b7r\'ГOlh*@cIo/?\|9 ~B$rVM"!$K_IJ>MTrsoS?]7F}s' p$rՏ]ʤ,ǻX4?dC*ޏ>s6|AD`6vYQF͑џWSqDnmF҄|ٗx# s;7ms 2afᑯ_*J/q7?*f9utjr3†b6O~@O/՗Ej au1J]97??*!kl~E:x:ZJV~8IjqDh'eXbH/?Wig3 *HSo?`הz<|hʐYǮ/'{W㇫E>ӛ6Yyxy{1(nG@2kA*FcuV*Op=u6ٓw{!l) +uJ2O=qu ?8yQ9m\פ'd/PA +zZi]ݲƒrv4XN/7 TR4+kj. 2CovDloU0} :gJKtۛU7{rv߲c&۾ O^Z4+ر\XS0՛,[?,ɶv"˪m@Ɵ_nn,3BMUp_V.!vIǶCJALvqXȹ__М\R mmh' +,Q? ]ZWuLo~_c|<+!O{Ur6o//2$^Ri˹(42bފa!{tk\\ rr17tjیUџ0B R2bBq l}m/b()a5т:V{9\^Y0VYdE /cvaͅ+GݯZjVo+vW5L + 0‰>V&: + `Ϸ] QۯP)ۧg=.*2sA4&!ӏ +`[囷@)R9P J_dŔB{zsbRӴn;1G{TM!MP^QfRyXD"Dβ+܆P0#a?]8ƍfOi{<4Vm^}`nu\L(ݾK}DuiDbk#H ےitbǶS_Rv.FURvY~+cSI?VJ})>(์U_Yk8n.\e&#J iX(иBKӿw492e;moD&7S#l/#/[Z7-V /^XQ/=-Ky,L\:CPɞC 6NlHpzB%vb y2gnr5H:~v ZW_.A\C@0 )|4e3,gOOs(g xzYz?Y?^bøG(?>MP?y >]y:t|0K !INѾ-wڱL>vX%^͗0D:֐zB2\ ʑ~p)y~8el2bJ}P(ml^quFG̾p))_5ENf>j +?frz~h>#?߀%Sl!]’^J=TwCdr* +@V3wzz)l(z!BT!HU-pbralMslkWxbͽU[a&816@A8hغ9F.s٬ʞTSYS1Ck(;%z`41~{= =U~I(;ym3p}N 'X+qL0|b{ 3B=9Q+ѽ¸`p.83sS>YGkU!Nqx/X>qѫ!c2fzUzΛNqhn͙+ȚBI$H"msuVTMW%jsE9];T:0YAkE3ч9) :"}3&!2WE$)n#tHSŎ5ϑ6V) ndI+x'=Pk@e,6X +DO5hTC(5p)0rX7̹%rG+ a_ 7F),Ÿa +|l'ޔWeO:  +MEmR*(1у}Yڗ(^6b/r_sta&a,\ 0_(A΢iz<M-V:7W$BTUpql;9hzΌPF"\َPL) ɦm$OftW@~]ٹAz 20MPVg_# i+l=NZC @̜6E5 ~]AdU 99 u44i>_i^G^+^ ,q +Id/gqŢތMiz_|ӦSOL +ds9+sy SDES"2;#7L'~Y +8G3弮I:'bо +=;d}aoy~[[Guw x@2NqZ5Z_[.+B:Ҝ>lfsJNxZCwCf'Lf +Fudkח*,C2FHe?DރI/8I][:`t¢?F515>A!27уa>c \jkt>P^D ߤF =)G1|cy5Z$PD JbU8rg[B$TRD.F9b9fP="݀5y3!z(_GRsK7z -;džQ 6_ڄ>H__z:0RS=S3u ݻ#z\k=;%n[tF~q7 ih/:⋮lC岮N]oz`zT"j.wW1Q.R`XVäOfN{4C~C9zpvSw2_EHuu2qw4~ OB91IZXf޾% H@h(P8/&]'KUp#żο>!au6}aJ.upH Y嶄$([~^E`ka6P"+0qPQz*z]}+): w(5ޖAZaƵh; + -SГ3,㽆ʇdTC7BN^yifN f98A0/*i .f^ ǩ~)Ir>G}} FʪE_XW:S3}@8JXf!"2!ѹin3gvؠd\SƆDG!g3i2G~"S@`c[nmA@Բ.Q)2(bgΝ, }u%\}(VC7$J}Hh11\ +90[\,omrlkZq`=4xov5es+?tdAqpa='M_ : 颚j+5 LGM<<Ġu[/24[~w!@)qR@#R Ĝ۹ϓy!M4FBz<W8Gy.s/)\\6?SB it#vby$36r%d '̘R#Lw#ÍiEPYKՔt5Sd}>C_*~ +qltR#H,"( CG{̈+ r_'Yx̠WutC:gc:.Z^%5P3G0O!}-/zSA-N\XLXvz J8Ԧ N3bL^vPh,FiPM;G+38Dtanu5wZpu#e42έ ~\ ʸx朳WִjC`!Ʃ [ e:US`HM]wRndYɐJ9hU$bΩ8<3tϳXbуSS}K=j%hP-@!(7D/|:)$2S}["{ ^2|Bj-/%D\D˶e䐑pTK؅5F#L^6~\[C#] j/,Mf_!'m#~bJYK)N0cZtĪ.IŌ|3tZ 1o:0茇J+G)~W0Yy:efB2'k ,UXa6{cb⢌H@V=4`=>}޼d׏'IEl8l4VwlX2 Wᩧ3)z!Km*.X)QnYXYJ8(dLWjBiIc7/]ɺ2:YG2SBeo#\ J|M,7dBV}Z 3CeXiЕ/!$BR= c rsW ْ>h#P#@s@{vJ\kDօɊ/ 3?Pa^cڴA tO#ѫAqra ͇1 6??xr$Z@ +, ڹ&& +G8,q0ÈT_Xg2-[q3$8B]J>%flө/P,"11a~m(JlT/aBTbhY>TʹE3^82Gv&&/?|6(y{8[1%u͝s%p2?\b1 _ + ^%G<HqKmkLC#b v Pt[,UYc.f#s4&$QƐL@Qiv4Ġ؃Ѥ#AFv^XtJH-Nhk6Xt=(!Qj.35ȑ2X;@AJ'%Р|%gf"F^ҹf n-VhF(φ'h-W3wk8d{Sǔ)v ,{,I PMS㶬^-PRM% vQ@L9zh̒i1 /5h{wpR ,"򉡁,rFCwcMѹNNS0*ZTr<`FZ}k?l~\‘(t4{OoX(swW{Bc \#l/ӘФMpIDM hGȖqv[ |'RSdQ\Dר_4(c]zrps:EW5# g5**y.bM$c:愍V";Cf1^qIi.4p2" ̢c\uas=oh3!>{UccY>N($c_ʼUs+5١-RgH.<+P4/Kf""D)$Hf8J=hzH0Ùq c8ހ$'IUV^A` Y%yO]X*I H1QzZ[&etNcsM/ z6o*O/<pBg0,) '4>HGm RMvPYU0{ +s GLFty^[ΖE:Wv2"lO!Rk&۴6s!T!F'v-EppIAV@$][ +(Er`'"w{ ;JjF2J\GtPGk=,c.ƱmrI}9m3kD\= ,r/B)aM+[J͙\ȋ[01YTz >M0(&h;n=WʄmEfCxׅ!]T GO +촢l^c,,? +pGhT%9TVuCD@ !b!8ts@hj_J8bnX7Ņ( Pb=cRӼn֕l9zV4+e~p+O#-;m}AC+8B>$Zldvri"_/-a)w&w@BN\JZmLfBߚMũjZ^Fkc.<%Pc7\ 8̸فH=L62j5 @%XcVbgأm?"R!g].*+>;`D@B_i8D!BKbCMTL~,, +O1F.)AeCx+Jk͐Ig2a u~>07%F@@M~^*]HXw ead"4M@EeG1_ ڂzu4I=gon.(56@gl:;pz@Gk+t#E@2bd v,>dg.5/aoxXة"|6^DpkQS루)j9vqG<6jÁ$*ېj84" 2s ^0`<݂.[_N 6RgM!1'f)+XTpXRXMN.9 f]LHLU#fvk5Әvwxc̥/pCHҍ! tTBycy)t(vKY }Gd%;^\7~(?#ėhg`1h_ի(M%|֡e}z|VZGj`_ VX>`ִ{07Y2hbJLUKէDK,i/8V8m#pTK- +'uW x;oFte_O @>^`ΰ4 +&4:= ѷ Ii~`D +3ύ bA_qD )⋽:#( +KhNp9(@{`$)Fy?8cYzBKy*.holFyW w9~FhHO5|z'mZtkA|E$zQk”^+1 t |,jh\,7QK'y uX1]ZCȻw'ԁIp^(FPp +bZ,am-})Tgy1V!7D=Un^ZK(Q`%7*g@B11A6"A93f] +H<] `&*luh8jq1ɔM:\Zi.C <A18;EWɂT cDxZjRq/K3Ԃ"=_ LQsE*RX^R ̉r,de >Rc +NrЇd7Fhj68 ںxHth)O3$4(GLlT ?G XyBkЅ;s=洀O2p6z~©SNlNT<N4e(Z:f-֖LZ J̟rĕ1:,ȧIaF-=ڱzos^+s@ bszVYQ"#,9'3cۥYIԹuw B!dsR)R tR Ţ,L QskO>C?\U!ܻ7>Ws8GK/BˍE|Yk/0ZaFם镬#OR/:'&V8~ +ڹ,(^>&@1iW[ry׵jT":ˁ=*ݷRyIčKhi,gunXDZB @ .]]3j\$AN5cjn}^h.3M¢fu->p۝V/0|!GI})k3ޚ`4R +g wSCm60E*Q{֫KrŧVR +IAnԃ/Ō)&b5st%d$^hh t'8)Θ LD}}$9u6\liƘ tp'=d 1I侥x#1M@H43H*Bn56镜)/OU*7bLu~FL0wRExTJxg*_gPD!m:=L / > VUzeޅ$ {wvݻ" +d$(.[zՍ:Bp܌>B05Nޏ[4`BDIL>^0t +?dd4d|n:DtN߱q-GZN)HTk) W04JU* fZ 﫻Mֱ 'z`K"QF JT J;(ԜŔu~`B_Y<;7kՕPv0(0^!uƂi +zWi+&## mQ2  S8=b8 m؅3@r^ŝY=䒣Iuz}yamhc$8Hz/umdT '駲jtdўK֊!NGYYv.C.rSö%? (]f{7ng-]&rpԹo<M44c@[E4s LY% ֐%T!:_ZL8vHK1.vI Duc-F,7h%zHF #vU. >`%u,LXt(aMNekh?t '{;f='dxS?'`h\Ɲ9/_)Uڃ/&M./PVa^ׇz5HH=)L2cJ"?Ԭ拠lKUʸ"K^,L$Fkrs,0Zn衤v,>MEwbKy8kwo )ej(Rziq(ƹ'7)Fށ%"4 ԫT*9Ccٴ廩Aŕ X){x< IRp4:eImͯIWB?zz@lwE*ʉVL(YLh[=\PAհ6er[B"C>uՙG5"w|Uu潕ӌh?T<qPzXW^=l3 _NB3;'tz]7] Z2zD\g)Y;5V)+# ѻʝ Lc6r ZԐUCcgC/H&uxr+!MR=_vBe*-H=H4zQDU|ݜ"ԡy"c=CB8\!^}9j&gJ GG=P81 9L1Kl&ZY~fnzwk Fj*&9ޜGnmsԔU$DAƻZǩ\g* gIᠺK`f(MH~ KT* e~ ı FӔ@ !Bg^& +ux5x EZ xY#4!A,# |$u5n#7 JAU}r)7^[xbcgʦ0za%rd$L-W9vq5^W`bP%j;-TK (]_4z=܉*|LmΝb FQMm!@ɀThDc-u1-Y%듆`iXγB4O%!UL. 8AI헨}9xmYyNJoS}q`-4U?b~-fze(ږTϽurfTէ%ck=%M)҈0MPwV6b=P8ltŏW>*\ۃ˸{1F5s(Ex$~q ֲTU_eCWh5DmW8u:cAUZߨ>)StzW8S/I-_ Z:Ԥ%8F и:(=r0ĚVJ~'apSGkM0 +Blle'khA$NJ=|okPԳ`?WRv(B.ȢPD;VzLEEE@L4<#c5hޔ\R?gwX %1KhcO|{9F˲"SFHDeVx rԶ׹ SˊBӢkr=e0F&T[^kh8~ 0TyՕY޹1qWNڀ匔OM [TzZMbUB}r_LXn2Ygm+d%Gds}w$?G\T}]y) h|0['֯/|Ŷ]x i!6\qY\O +0zm)&_~(Ve"I#oi'=>6=(#WS/5Oゼoou^!VOm8RKʴe{ oQ0ƾEZ,ll୐xBD)uP#"Rw%ɳDp 0J|1C4Ãka& W^]/u#ݣ7vq5쯠BўPujğ}Jȍ(}m5onhF<|G8ol{_5$σ) 39۰O"{ĕQBԦc3i{ǜc-~[jb GqA{{AQ-{$66 +5D +0}XaZJF*2==Eꥈi?\s;\9.'xĊ[&f?p2Ɂe;%VyfLOF(wF H-Tԋ<$F؂ĽĴ\Pn)e}S jX2|()F'`2B{ /&O*k\6%w[̥F;&aWl'U ܹE2'eߧ6_ӦvQÞgK>0SB;CNB<+%Ǐ(B +,MQִ*R4!M,K b|Om9$[$TR d4Q)=㱜B=IUԮ.W +˔=T{ރ`_; zB5A{vORmUJmry­A>kS/Ph4aNocpIshqdGRrطWуRԌ60 .Oi?'<oG٧3r3#&.j1lJ2}g0Sr-GڭY~QQ(iwdh^tħ Vm6,͏́?D6r^ٽ&zAe/$cMB(Urۏ +--cBġ?7joDzs%yP}^{?i^֪Bug|Jv&7e.tlLTȫ˛_eXgLY T%9.Inj{muIw !#vh+~ykL&"\)X `C{d%rW˃XP;AbpͰ_VC/Hݨb)9,mv^M!9yk?PLb@Y< -_62w ɭegwUd )9>W`o +YD˦^ # 3,~(.-{?DWD %md& K:",`㨇x8sT%V.CVYȋPʵ=bC{Cm==^osWA-Rryf4?!R)SzNL؏Jv366<~6jMܐjcl@29)}~GKQo}$?_uYgKH:sSIp_fBV҄z;jзBȺb(l+7YZT}o]H{N{b`LxKV<(ނizh@XY$y,=n#wi֎_]qBN5AϐŝƢɑѸG>}E 6#2A9'hee߽>j+./["ߣ0R4Nx0}V2bկ%Tc! RJǦZğ.Texf{%8'^jyw4qIi HEQAl0@ߔY7/@|71=`W +ࢮ_e&xRs{h "O*QuOR^G +MHΪkdD|ejkFNvy3XcIQ,Pf˔֒煔;85ؙ/*@4Hb]i0Y"b/k&ן(+Nmti't(8+ƒ%#EQD$OITX^&б7JqeQNV@rU<9;j5`'!Iv)U~'|:Y9~*bQaY0|<f)(;}%\cqFPWO=dli H#KT _e}nٚ^Q%wHl!V)d6H\ + M9u-*K[n qЁ鿖L:;e@Get'2"#ڒZ2Xr.b]Xz8&z~+d.$[<-fzUmNa]鍷-I=|QC83~U*%x\ܦ P[ ;ĐIqft ,DD6ƺI0[Lv3k \QwZ!js+H @Z1Xp,FDJRߞgOeH/>y~GJ7󅱳),!IAʴM`yeez#lWW9/R؎u'wÝI} xq[G6.r +#|9q˔ed|FWxI?tz0dl&ti;H#ּ9J )ɏG(cLA/XݭX]W~eՋ<4aCjP?X$`ih30?TNO$4e"pi^R oY )q۟?۟_ͯ~___|o~7?~}߽Q _|M0cXb (wgs *dFJJp(JM}3D``\d2\ +-g~ N lJҤr*(nye݈>%ЗsH4?ײB) 2AR9 KrJR8cHAIo-iг}xˡPETd{8ۥ &o6V&,0\ڨ@+}XyHFxpVDRB2'!Hs}Za )0A56O0oρarFc:=޺.sbYƎ;jF&. ++&dY ftNӞLF~-3'ZI'֛%+ymj8~D‿JD[8_a%׌Ɯ'nrm"ڛxZQ[WH7bt'8@엤D iRoRl6Cկ @YU.`Qd6`{e""R>AiWsXAm2^D!9jr Z-L R(tic<>0}&sHqG,Lj$x|+."Mq@eY}股, @U>raBy+'+hE -b<j{Aߐx,UMz ׾z 7?>PtӉ%K@Wf,i05?~p`#2ce)zSk!b  +lmP +oJj+Dmu6Ҕ!tM7==gqEyُ|?BQ)S\ Yf[=vw5{Vv|s8``{(-zXl; 2À{?#K C/yŦ.$mf"4 oux(cŻ,=ыqyh +.G(!zurUdTq?Ql59tc!U4 endstream endobj 36 0 obj <>stream +Ö8{@үY+/YP"pKFU(\l> ^?$D *#Q..yr(mȺּqmvU~VMfd)~u[%ggKe$pKN!p1Wﲩu͎XV W_ A/W/v7|ghӴ[%&7*€=Rd`D/1ߠ(5CBZT*q aqr}K5bUW()*;pF.\8%79]x t2Ev=iL>茥SX[v D KAƒH)mZ]tz!w)-z*^Hr(ke9#Qb; 0rX.]|`7/caⲔ$x­BF2Z`g%Vo .U-T='tA4 ^~|$ӂ7y^MӖKboMh +~s=*z7WLS@mڋꪟr +#%)s`PT]q ~~CbNǑQ}\CeFq5ו7Ҽ?TFs,+t|%xzAYqhKh!E`.O%fw蟮vܾ[УN AMep*a3}059xaK#En$H#DXݶ[ޫkhԱxTZ +$}S> oVo<ԛAWޅiS  ~]@uk80 =dzޙ}2pErʁF<}P)4o|+`pp=szJ זs+>{4{8n.ל){w`qvM%, Cg@]nu껡K' u{x7yhgQِIJcDޞv?)HIH=eI}2 Rpn.?ԂS *d\R(.T¡*Ɍ(\v\-b[9ATU}$4(Ad/~2tXChsѰD}b'#epԲb-Kds5%T$Gӄ=,qm"ؠ(}{vv+@5cOmp"^xv}˔/\-"Or(~u@\nלRUn 'Ȍbể(r5J͙۟0)(}yB2c1'erɳ[X+_r $q̤C3;r burK(R~?|>8EW%ۍg@8\q aCAHr?I; GLجO{M-0| +fJJ{pJ;9De&KuMs_sb?xnB@5Qߓ@Ca44A wx?"Ն] +t8Ma +Ů.eO(W+az^fBOЃDTpm°UWE96颰9W߳gE8GTdYӌf g{w[&V]/>>s m])wC3[=Jn1RF/$Iԭ=7|a|Ln7 >_22:.!jw^jy/a. _"-*v^Z~)9hMnPSUt^+[PΎ‰bm{`|)Xnw HIyļ BWuUoV'<^ (MC3 +,%+OY;njqGDGf!HpI7g+RXR8)j#D. ~'-%$q N_tL9d;o(G1j?ž&6N{UH^ONnfk +ѸuPnz;lV%Ba)}{OctCeW;{ +^A FWBmU<}Ѻx+Zw9pŚfq_"79,JJ!vi&۰|sEV0-g#.lGsvrj@Ҥx +B =HqM$0uڮaV0F((KDqobM1(`d/س\%1 +(<jr$~^eǁ(0sBK m3-bTLoo\958,̕<*j^1H Ԝ1VaMN E擼QtbTj{PQi0 CH]I+Ps= ˫!VYby˓{\7Ce )!9P?[bPL\nVq;_ +]qh1G~!YG͈/ODbIa5HO{BّV H6+Lb{*S}E:-I"SjѺtSM2yR=Xa?HU[^ H4-$84"Bk{KCu P<:$ތd/#̙O:[%m8^KFOl_rSHZIV 3Qԫ\DBAġܫ̈́9j;V2DF8%n)N.KVu6 +FF96I<>;W.H("9iÂ*9pG]vtI"EYQ^qCbTV X $n .F?e6l3wjr(j(cr[ <= VuCaWუƒn7sDgV '&( >U2vPA\:MV()zGM`O:@>8}/ҹKJyrl#Y& רw4硦I1S@v`BbRn%Z@0'э~ߑ0B5@|bz $T!Vۯw*s#+SE2D7\%tOɄ2 Pߟ §U(^J~H֣s*-NiRBPx5aiaY 2ba1u]Xt+&~z(RW+jUe8ЪX{dRq.RC5Р8)$6=$\73< sTR +~9UBt5ij؍A!&?NHTS5.r#*dJt>Q`SԢN{f2 1!Dn [JYq;x8FD5) M6L}VKna=QEߓk4 ԧ/3L۟V +Bѐ&[;,ÄpƐ=!/ @w3PHEl90GڅS:l۫0A0EމBb;BZw,:dB3GR EmXC8*0Z\RtQQM3u/Zfj +[]RyIC'~"cjcv~T]D}5X 9~Xi Ds]_zV훈qdJST$Jn&,At~Hz]k2~xTJ/E% Kr۹z?@1L܅\:$rN"vTve{R.uc}Z9HWL%˫w<5,E̫D+B CR ki"0B[G=KVx &Jc%0n JIS{ A6 'Rbbn\=G4qXN}n"(('JLLs] ,= veYO!!@q8np T\q&r-rD*Wu,[]zΫzxMqIzIMP#.%keӵ07)$p +x3qI/[=ڹs8#ۅ0-G)t1p$Q;tG^%TBzRʏ=6[j9"S#(+*b @6G#l\&>k]7-wN`DNpFm+WBwVהZUe/C(맯- \^zOaqvG'I:Eٞ[=;N#` Q2b +8M,+1;ܘak}]bB+tS4=۹)(Gj!(aa 2t!4eCݍ+6v_^ѭ9(8n9BxpɼKG{z ˆ[9WPv@ypnЬײ>f4\L9)oyy"Cbxy?9iN<%AQI`-qGV|> +%(\@(p +5`)=QMޡ8@AB.ǎT]sWڒ6/cDNAlVeTD)m}<9娧}>XuzD<9ЃKehe~8]R{9n%:xZ=OŮ|ZSeJ%XAkx_SH_{_XoXOy"=)Yu*|TZ#!$SE쇝}F3 |w98}lU3Tw  +ՊA{nRTuN=n{CQZ{(7:PM=&tTʬr%C-:vх45NѮk?8yh6\ns@Bf!|h'A)b W`֠pA1kt=nwtq<`f+H}.qN5*=A8WnN&Jb!({s.Bݷa@! `5`fJ0Il b/}TAb,Dп. Ky432p x.XuЬ(# ;:A|oH9 ++oe}8sO2$*KF3AKHFZʶx\19BM7"nopaZ,EnF('|XWHu$80&0Y繐g킭hJRe$< T&REV+B s VIP\RH^zDia1Nx J9U|)J& doL&>ɡg]n;y 8WX42/uM7SB!Tq.Ay?&6b`܂Wb@xojىW_,$Cc_Px=G]A  , ?8kI13 ]PƊxX p8 X{+Y oآto|BO6$d00fmЍGdU݆we)w%-mn@Z[A6=_ü8,@,=d-H ]:z.x7Ưs3fH'mlJ/qZ|^@^.h {gQ:Hl/CU(ёl杈}J ⯈삌e#٢ AsB'&OU:XD8Շ^+B\5VWIS/#mئr%IC7fK%:jC(RpwaD$`S0vr-I@ek2lBs4^%xUBRd,VjP—\$N.K-2Oe-VB (XHBH9_ag8_[5M\՞ȤP6ܞe-!xjI m^uMN52Q΋%NB9$:㼬+*jCN/K^IW g( + lO͌(e \l<}K.&e' w1~<=:%4c[%֥b&9;@\ߛ4[QAow L@e9"B]0(&uґwLhb,F̻yF s4AnoJC6{ /e/$9C$m%,#1&tZ5Z/T4+*R^zG`$ UԌAUJPo0vGKo ةpre7Bأs0"?>q{ 4 YSIP_^ do5 +:S'zΉ˜?S~PĢH¨X"BElsʬ>TCIg5y? QC[&J9$=W K:`H! .˙'N@6*l%'8c(yKC辚/HPw[QNn*$;zw$5{8M9yF3ǔ"P =e}T5K$XbK;KQn_Imká''j?0Fx`z'Ez a:>:\ٳ%odّJn)R6VrX/!+ܡpRZg48ௌ/(-;+ğYGLk"սKn`~E7KҼUnDl9"W;.Q* Д|m5ϗ̣=ǜ+ +Kl\-d?B*@C9qqj8LJ,dؖ̏#(nߝT$b՛f]GmS"5Áuxj\IRza$U96n,sEH;N˩w _.W9.͌jC'Y +}2F i` n`8:>(gQkȌp.ռ-G^ bɱi p01 +SwvQYje,B"A)#uʽ$#YP&B W>N@%OIt1H7L=?tH)) 4vcreoZ0pIbtYXh%J*#[?ag^Cco^>cHDrpT0]i%X$pp,").V"?~渾_`2;H5^E;NۖEIjU2\,@90N +xmsG"IC%v7-Edဧd$ ʟO|eH%(g9";A}$f;dogDo"-c!I:ˏKYmQGK.r N +~ V3's/P12-pPgMP+A&M7IB$4VBK.(;R=vvSGz|? +ⶒ@J1Ui4#Л&db-N`fxPcJ)L5D.BW6=EvYk/$eؠJeFPMߑF/E6O##q^';V倹d66Ca5BgTb5b>ȧ +Hk=nگ4ֳBz yyAxXsĐDBBIDl(:!gp7$*kUt2zN1F煭ݡռտ"QrGۛ,Ԏ8{hZ/^ک~XHEŦ=R&.3Z Tߦ!>ƗCѪqb~B3°}[g(myw*w:$)Z>n Sbz +ߊv ]஗m:#nsC ںu`8DBUW!:%`jz&8&o_$[-~/ +F;3n[wy1⭧7kBlD%2Ms/ a9QI}xbܚ2=-G :H@Y@K`t&]O{{@]'>نyle? `ӈ5}q*ԣ@: S +gQmqf Yؑ-H3cЅO l%l# OrQQpb_3lҺTtҒ{\@RAQ忒&e^S :\"Oiz;(ge +d@YO3 Viǒ%vzU|["TxvC^ڧlvmd֬yQ/?*k͊!t7v83t_D K~5՘MȫU5jj,zv_Blam=@ Vp5"\u㨇=:$2tjA+ށC==b3;<|)gM$cņFn*"ie YGB-Pi]6S'قN{Vׅ 0i bUv-O=Ghy> @8*]_tbw DUJy S eE0:m3/xDy!?iwO&$0zg.LM XBR;6b9"AyzX.j@吥 +dt/K' +KN@!1tOaYÁɦF2x:P}@`)srR B0z8f?]t37 0ѣ$uu jłM|+t I VPǵ⢋%q' 9tJb&)ԖYؑ_h  44$IA_orfLu/t]K،ׇ̔E꿾م\l0V/-bM$Tռ{#IJb,!%[@uSv I+ѭ^1;,4'N[@_ `٤v&s?EcqId @3$Y:Iв2M,sm:U,(FcxS0=xՆx`*3q:A\/ ߼!L\)DX()![TP aU}Q.b' 'Y71$i7HC*vJ>VgLH=004Lh6k,TcѴtO "?{y.Ffs2֜C*&4fpFX ++$C7]PFdH<׬ +jqK`~bF_P2Eyc@$JGqhAjk]"kӒ=~h +T2n~&zOvWJdv/{P@?`Ň~u'@HO_/uF`]59JPph iJ%<؅n8!|)S%劅:Jxlztv V\[R2\J/qY۬' ?ӈoOPfQ9Y# J-h %;1S 6(c/nv#+Lv-pEqɨ['$&Xfp +.O.S"ku)>L{i4'D!,c` +oBҳ\ Z8ɜٸkJRHXfZΩG[jt>~L²2fh?j_nZ,*ߧta?EdC`C6CگA +]+nah2A8t$[en2 BK%.kg(PI@kB]@i/Fp"Xk+xJbd!-XR%G:>/P(i' Uɂ1LTÔ!4TDM!Bѡ61l8P}K eTo?ԢP3n"0^yAf q'sN02} +IW^$^A(+EE +\?Rc_5qXaC't,xud{PnS׸ ~닶5neo5/~H;bOxxQOKk@oK_zD| Sswlg%/47QRI"JK +NBւGSʭ_.&H \]ћb蠀fcCz8,|5;Z@ lH;}E(%AePNP!+H]-_GyM_.t:ܫ)s Jt1&}ZuJfD*K)ME4>b&/*;☣lX
s.5pu;Y1R[y\{dV\0- 1:MPma~跹p} <.zg}Y殒r'onhw)uJW]R%`tAf5yNvg) +}nYtyJĀO(9Y L[~+:(*Ln+KCyNdQ0_mg|\lLKeUS'gyPoBUt[THp{dst9.S@h<;8W0]ቼ9h(Qm()9 BEut&O<%িBVL^m ciˎe[V(ݖw w+ҷS 3㔷??_|~~͏߿_w??d?0#g?b?}ͯJǿo}b/o~~|}Xo/ݏ~}?++_oyťgZb OD7_:ߝw/}Wg,W?|~q_H__Uu~_/~ +( |a7a~oC, ?|_C@A. kTXH ;Xn7Tdl($b(A4jxakvaP3yhDW 7etcf +onD(~ɍX;cŋ,)D#;_q D+S ֕;f;cLt}x`=wD9~FWϗ|u[)H )n8,*eZ=O'`BBH!QK煚[ =NOZ_my]qǁgsѳyLÿyb("ٜHDѸ?h| ?G#n㚋w'sD>tGqEdH#=[[AW^{AWv0+?w_:9ȶ:P_2Yo|IdѬ[)-)h+`4Ƣ ?s!w,t\j{F~v_шݓwHrm}/eX=AG8߈K@h9o~㫗z{P$VuF-Vǹ7'j6n H8pgq+CF$1k +/gAWV $}jc3ek᫻z$t|LY {M=>zb,L9~7>9_ݰW=~h:<,Xrgn_4jE!)|~hY<-ީ>}/u:-_dsoRz}><5x+#guG@r-m4QbO444zRz#0-] +Ln|_njGs}9ӷytKySfa{y-?ZKkyw?C6_][sv g~udzBNb@j4 <.XE\ ŅxAKcok@G 'mr99hxh}3SE4߹ɤ@}#ra3\8l+x} +62>o`t3o9}>b+Ɗ go_L_l|Hb[ + +:x-'~Q.vn޽h@Z1ꕏAKR<^X@>Z@qAhUx“ѼWk(O4_껌¯/yWh_2=S^Jcx4jnXhٷzc7\e[G^sH4֫dh%}DJ!OaBܾeEh^}ϔ{vyΥq{ʠd>w>rȒghEQ sv7W2,̞Wyט\y4T|][ D֛^:7[߽F_eb%xN s|eVB-'0XєNV,߯5mFt<Ȗ3l[[s^g$mfsWґWb^\;^ؐ,XWK(m4%'x6tQބR ('/X9^H'q{IeIǂudaUY5DLg<՗a2HO6/7ֻ9"2%_eyfngD1I3@Sx$g9 0]66~ίfF(fu+k}_yE؅g \/4u2ҒFkpw+-?t _^%j#D\E]63Ot9h[Ɠ}kѫ'E @B"m=U\8;?y]اWp5ΎLƙmx.Q3$`HL1 '۸7Q"~ dsgH.3xϲ%PZYSc[y(Ԟ>ypc.o$l'ONPy邲3crx3{Oc ly/WS (@dڟR&V<0k퉞Vϰz߹k9gU0):A]ɿUu);yPY#I]_sW~akq{ +ߍLJFYϣ7C{,7gsGבynVmDud\]y`Z\7d@h+<̃g!6z垕u6_8)Rq2ZL%Y3 i5r'j&ί(-:J!?o4f&4R7Vo Q y)yPI42 ̻xEd|2_Yn畟VF&lI +fl6w5/^.DAdD!?[}2ie0!Z#I&cu}8S< w= (X{NzrٵVSg25F|kv +=Xxߏ׻zo]\%v"gA@,_A^tܫLybvūMu>7Z=䓮e:.Z\9vʌ-&mK8H +sXl2{_I}ڈH"j=EuUO2vۙ9PiǔՎh,#>#v0qLwc 9@VHw~1O vs2@+WVnj}4yewwi<[WHʓtqX'L;UWL7\dH:eؾW#El~ej}s5lD;Ni8?fdQ1[Jn?7?GߌD7ޑ?6l,w!==Ov 0v>g2?G|Ƴ7Km-*GՕ9% 13Sy %8ɵWap=<9_m59,'ؽ\n}vƏ DRy\f;g_:qOfw Vdr [C#*o13ߨ1]`6gFa9żZ̺JwZJ3*4F\U},8I>k=NMi?RλF;sC gm'y,7*>3F! nlgPO*A zS>P9OOkգpw+-=OY"CzR8l<7EƼn|Z~VxAW ֿ udew]k\}Uoů |sL ŝ+nUw{3j}F=wI]H5X|Ω<Kh8nָ5{9#9.=s_goyJU4^ d@KapWK@Y` r1ޙ[~|sgYɣq-Q} M~O=ͯlœzgCW1Yk07W]yJprh.kޅ]1~ Y.y~:%arxĸ?P9U45Ϝ*<ϋ:وg~JcJYD=N)[ܳxSlЈI%D_vsM&^^cMn~)֊eU_2%u̬5}OI& ī't=3U_/hzxnŦfߌD2}RuLwsGYaXA DͮhiTquxUwڜڋ/:=neГ3@9NhϋT _ :kS,es̵yibSfb5sW6f_`):|yQ@\okDK-%9䕻F}zۃ(8ˤBdlT͗Vn~zB|Gݢ`V=q[1C< j_8uLz# $EL3Zϗ#"0B N)G\:~ae8XEw%V׹7I>uesOͼQ7*ͳw5|'*\xɉWJN^zF}w (fӷ|_9_ +ZyZ+3#nkƔ됕ƉhȀIO#4Y}dq|'P +5/KE;q:u+:FE|%gfX}mW\0"k絿OXޓH. +/ter-uHk6;_a!4wx4?I4NC\|L.'X+r>{3 s>7I[KY#Qsߕ4ۋD_{Mzʅ|{\rmʕZw$NtC i|qdfzzbJXz2w"}k>{2-Ӣɛɀj'w&у1VJ8(x ^sUoX^Aǒ㮕qk{ɜ@,qG"cG{$y5pσ|FFfhTJ #}+|jLlА%zΚScJgO_)2w,lA9ܘ;1(5Uqɧ;2q>Y|g^ $j:m4&{=SJP Y_ @;מD6cM$*?%7,L.;oR{SO|S5cL4S?Ú]}P#) CȗV BYa9zdɡC4W3q57ϕYVAM*W2#^[7y݁tEJ4I5KH1@otRsq#jB̫rʣol5X1ցhU=7Y#&Lmgycc)_ssX :3qc澻uݸ <$˚SⓧjF=&eL]vl^B[ͼW5l[ *3_e4ާ1&)\N:UX` lά+Lg Ȱd]\tN%#2F}%RGvXF $u^]4$LvvŋHyuMۜĉF` rRygJ4bCWT8 n|/*m?/=1^rX4GCy͚[Yѷ9Uצy]Oͷq8GYdrbsz" k 812w9NOzsG;lS~(d.3E[V2<9O2>ۿWW$mu'7U'[Shc&b  R'w%o=Yi?;P頻{}aP"NJ'tH)ƬjB}#vܘ$\e*nJ~HDdW?ٗԪ[<3s7p&"ѷ4dRU7d.3~lӎֻBo֝^^Yv pr INdXup Ř4W#ڝ qld 7"L{܂} 1[fgHS]u=)w5Q{XʽF}5"*I8PTdM5ݍwP^^&5eTeھ G ECBr$Spb2P|\AUN8qXuP8BRBE£t~'U=*?a$̂z_\k*2L|/aMō ЯX+S(hޝj,lTQĀMفX +l^b{"D,e v fP2DBpPf+'q}u T5Ldj$nǓ*w"/f*%Sa/AIoMq"PD 8H`p↸RQ^-웃 aLe4,>4K QS1!FPU) U*_e焙Tya@+LL bA:(=9YMBzmzbT*͠Q8_=1Fb䦼ٌEhhh@_JKAT/* U@s+JXD {c(zڟ(}5wIKTsڇ>X]R[lR5|ia|NtzjނnԇJ®ZzWP<@]WK5ʣ. t` -M ^[Vrܨ +ʂ7wfJf=C $(^O*SD(' e* RTS~Ѓ$Ta\Bn +EK ! +,[+|.eֶ- T5C`0KCQ脥s}!"ӓ*,-\^huQTU,KդҕMMS .DNp*_bF##Z2T3R+Fu%X}PzjWzb-2Hفq<=r=ҮTY/P([Uqe&}.IլvjR@Gnq|TY[ E.+0C6g*TФNYKH(uCQ2qUFu52+77&}#e 0dʏXDl#U7S4`)ƳD䃛E"hX +u@5#'(e!|ʳ1U1#,MuukM ő5'銊#u]JlԕbuNe^~V]5F5Q?Y:p*w+E/ +$mӚnf}æh;RvLU4UTB ݤjVЁTԒ~BB@Cb"5TUKO E]MODP"%YM2x)iUc@8J-f(>*-|__& +k&o nX@1BB >BE}>XDTr*\xVXV 'Ԝ4k)VE*\ĶOv\Z_XMT51a$oT5 UEdļc=84Rͥu*ň뉽z.Ec(c[e  +»(yI7SS +F[ڰE/ +tE (5Yf(a5T[p@2nP^Ձ_o&JD1Y PNOYL5Qa(zk +;"cSrY CWʧ/b4U`HIzE*k,ZDd~?nT?g S;5vS_7WYl'[]NJOU妿cx۟NqɪfUNJFAQp}jUN~S73 jY]KgvbPI6Zա:BDLF>W.co6CP]H][L66FBa& }S Ga(&VúH(&TQW6RFAB>1 vrtbu^L+! +~BT)9eZYEBpt"hO>RB>uM&=5U%[=P@@pv+.Sj6 +~BHèF*ckYu:,GhFC?=Qua"OU[%L QES7}'0a:P~b͚m+}\,})W::nCqG ɺbغ\DDǹd+%}2F3i#I!Op15OF(Y{ j0tѦ}3hGr<4iQ_H5?M:khliAwp̶5؟rG:ș4LBZrHm3n(~|XDƁMj3ʯȀjC%cZ44itXx&l]1 J$*"S1r$`c¼6ma:iX#ENbnʮF NBp~Zh崇&Vٌl\/X.֬ a{-Yzzk?k@5i5elka.sgnn')4f[%֜3Gl3#Y\ +]Hf[?w8TFyiX + %r[$9䌫M{kN9!gP6 yMT>t6<<-n /z 68o,Y=J'AYc<#'!cA~hAkP.+4YA|T)ʐʞHvmhOE| >kEb 7ȼMh$O07x1aH;?m\Iظj۴O$у)($3ySIp)\Ld>v=L2#A mZ68 F<͟]fZg LIoLy bCG5途[@6(s 捴b<鈺ɴg Qcr3#JH@-+[SƸג㦱y #ٲX4)ϰAcZ, + uՐmբCI䡤{`Bϒtg8w`"сchAּ&? Cȁx~ܢy/M}s~2KrȺ%qޚң6^Z[.8o9¹ ⃳)BA G`:"w-'Odo&哹HWnlTdER.i7.tN璷B`*t}6yp&.uKИRlCW}=x;xKBt#^oo 0'L3KҫR*6$w,:HX@U>οaH{f7=Ɇgs.f.es.c؄jD9haxD2k_h=re_)w]zud]g.U|ހE:d .8m cqp# 5o&,a4qCX3: +7}$% :ݓAa:@z)<Yش]sCh>x}x!Yxb){dւti(u%e3J=J#^HgKMN$<ĝ3dߑ> ="]˝|0bk9QS(_4QahߔWp*`5>t*+.c[88-Ƈtdm)s +] Ag-)~VȖs'*%aC1jc{ +#𺔬 zp: u^0B;I3>NhAEO"K&Pa㨐±TtW!"k'^dA £[`:( 2LJH; ef`9@#֗I#mC{P+0v m"_yoySA>HVL]Ox#<;0?>b +恍VYd_d_@ćd,A!!37 XNZՎ0 +=. 2 zF!| )LR 6.~䦙GGza2;fPHְ"a=I$4W3xhg#+uh$r`mcCRG>]@6tG1?1O/k$31B +a|I HV3!nȦ#.~g0HgMFXx~h/t0S 4@>$ܵNZ2-lG]C-8/f}6 -aae|ݦiN:h>&֤]DNF dBl, h%MV?^^^_Ǣr'ھZޛvcu S*]_Тq2G_-KGw!4.٣a"`||8|(K!nQ2U0wP+x0O.,u &0a= +k#ԟDؔ!l5E1f"^8Zd}=Eknwl)5A=裂 TӫgĎ)W!QA9#56遮] ~!KC}3Gb\Yx`&03pt$(@6Ek?]ذv]f q! DDxovҠcަNu&r28 )1r9Px%46KƾG\:G |݊GjY6AB:i5t,-Aw"8 iѰF]E祀1gD,=g@~:ZMD]C:p"cqp֠c@XD[D8{#q+cl~doX7#}PdcA'ba]58|\Xx>&I/6~MiBe&2\1MoK_۟"^xaB]G:s&<l-6@1 -x,aL_6#'>$];tۦD}gitTd*FҎ/JՏ3{+nv%r +RV]Iخ1G9P%׍̶$ؼQH`M/' + 'M$:A:p|+ҟa1ۅ +1fF^>a-I-~0=Mk^vdl6ZCy$#.wFL/`z" 0U9yGekɫ|6#"k~gk_p +8 +s'0>[<{>'aOWHP/ aMV +2:FI̡_gR!؈9׽H7 ;,df2wwtyTXX:񗠴Q_FҾhl^3ͧcK_Bŷ0a_;Ag[Hֽ\N<0⛦]d«&QE'tO*gP9 7dIjԁuV_AVGԶO_1ΛXB[d\5LlO#.oYmCY}׷YV/mu7kB +u)lX>Fs^PKY¤]ߙaӛcgнd[x"yG|d2aa &ħnW!B䖯s?z8&~<ĉ袉Di]rϋMv[=֊)v=CO 8;xtXriȢ38dyWW=2gCC-U|}p,x6-1ʤFy>Qho7cp>5{g.HT\7..L'$\B|Oh63F;Twpif!kK4Ȧs)ͳ+&d.fSA6%P\僕lUl1@КGzk0^ȮQvhD\2Ʒa`Έ+RyeWZ5NyhLψuGk3l0[&.PMGW:|=u&uxF|xPK dީ%[?%jb]>bbL\*sօDͽo膮5D]2Il=bX1ƖOW]3ycqes#ypx #&q`bZ6]?j_v<⇀ 2G#69*U߶D;?cv͑״}'oyZ5{F`"=s5:wpM6lQ]1U{oUy[=MN NM]=Z͵m!ZB|Tkԁy~ -b 7Dn q48ޝ}B?GC"ASzo5({xнVVwՄNa*YGd욧@s&_«0cK҈6ܢ G 6da==ۻ}1S=# #ƌ٠đ?q#'d`b] +?`ۀ_cUSStι=q\a:|3e&Īج] [&docKوZ.Ќ mD=S2B*v*pp73't&fA»"{cnLS + +q[xa BxjCS^ið~G|Xmnl >O 7i>yhhȶ? rG)tȎ'jcDyj hȪʛWȫZ7v}8 |ooYAbaf.!nMj bK,7X>^/Zt +ľlb^8r >,=7GaBrw3ډ0j\.'{*}]|J>ae|C| Zc\"z`"佒c֜ RUVРw[~gdph䆀~*cƇ K"s'Skb?dx8|@.`m\ ȜI8q6-E@a)Gؿ[7#vaĽy=֓׿^N .a@bǫհNaa=T8V=p FX{-LƇ˙9d .-,$-YWHo6JV~^q3%_+a o@  +/f\4a_ r#ؘ)`3"ƅ*8+ozJ穹U khg&3Ri#!]"* ƃI08aMtֆb=A:B8b=EI)[q;sad>Uzp&Aғg;Qt +z.4)x p~`}2I;fEtԎ)r!dPh?o$ȧ窱ndŪu ,%$.#j .>,kgOׇ/Q%?4;WgUxY!ۆ}cqr9b&׵}Ooly;dFl`9ϐ Y5۷)8ߚ5ZO GO! +psYy C A\$6]Z7lyS"^,!%D8d.ۜѵ旲º2Sw5]zt،3|8$${, 1;*YJ7*:O>izmƶ<3'Z?\N̂5@_0L=:G^;;2S|Zl.g>> +Ȗ1y{1g 1iĄa F 4+:"G5 (B1SL,Hdd +t`6}hp:qiges;xye`ـ*s[˸kp ++C/3,=kB=^ 1!YDm{>n݅C}hk`sgYDM}܌j^GgDL̤к )KD_ a%!f [8޹AX|OrYa|v'&펰A&j^4=)`f +9S#st!1b:k|l ҆8 6> +Utp^986}<)p k@o`>y_WO2v/^! ̘2-a(B +;V|&Lba}왋s@E2ĔOka^Sy w>*8D1w6Z2r"蠢t +wU9\o;AF D_KaIJ,?2 ydUu[>}yk'ulbLLґ8}0.Km8T: +_ڀ8*pJes ]=ð݇9&=֨)C'1PaV4'Y8kmaro`"`? yMö=}̗H^|KM7 ! 3>M?X~N12ϣs3k#P|lFhD6=]-oy +|Ttvȳ_)}Aڀ|=fby݃o@a䋠>1{q, > !Ko6jMQ+Ε"Įa35Y\XD50ǁ" .\cQ5=a햄?8G5v0䢀Mf̩ߒ&ۢ˝C!+n([?ʿO5 B^XŐ "rQ /;I`S3CR%d=c>sH\CMBטƾO6B)*;f;qEW0fZ8pܑ_Kbk Ȋ<6"G+[ߒEq ;klgT?'dψ?8n<q~6RQ `+Fdc.eil LkA6{|i͆O&|l{˚:Q)3ZjwE͔i~l~}%d5#޷f8*džfv6K?.8@wwX!ӚgBcm!M4ZI4YNܖ8~V\2 +H'lxmLԴ} 8< ~)xJ잙\Cqwdۗd9G81G:aL*|y)/`ЊQDdD2nty/ɽXe迷!.}J@;l|YM4\Cm͝r/>~Fᨦ7ڤVx]EcFf@2>9gtU {{r;Vle |@XET5cD?3 wH1D؞nyj}j|{&!}\c2gy엦sO.I4X^xj3.}Ktdd-#y˕DcJk=e4wl"W|xvyo@N@!w֌m`C/֍~U=FZK?j'wۙ:b?nC蒱٣W[ȿ+/0jiy͟iw=,jo7ZfN^7fLJJY5]'mn{6:M%IGgަ/1cchtu#6aO-Ec AQ) 4mJ.O:6Ӣ53~WiG^IvZ'yJ=EC_ycw'Ŝ{DȒg>pܹ'ӏ[趴`ke3O/h_=̝d<&y6SRfH~8Gj sjKs>ϼʞ~̜~A-5O5ZNyaEzNQh>ْ8ђ>$OA樼uA.A2M ^˴ܢN(gDCr}t#] f!o|LvOɝ7{_oy3q9u>74q3O_|{ݏs9DJʑ^Y/eG"?I_,[_γ΃ۋ7mO|vvoZng /-v#g9>.غ-]|VOMK-wp\8{ϛ=Ɔ9N{~i6c[lߘ'RaCsFA~aS:Ͽ)e0c_n ެnyꃩ_j2r^w >JEtB@5t3b{˹s7/3=Orm_-vy~ #GV70Ņ_S^q]ϭ.؝~FVf+kűvz;9Q3fZnAzBnG7khu䁧V.[#7|6O,#OP0W0^Qg)i {s7Gg;oOĕ9?j#3C\bG}?ƿ>A}iG|+#[?m=^e5pIqǺ4lg\q3ȷ]wSڒݳ9t1g{1\N}a-? οW~qoQ^{Q_Sz|s9k +lqK~)x/cw3.UW͇[ܧYwU{S '# u9¥`_eUpb{AN'UR'Ym|e~>֭X!+gd]7lݧ rCmnCm\zjܹv~˶XeǻuHd6 LhE*l7B~W{O1ܗ[ܧ̗ә//Swrݞ{u7&ˮ,RҳX}W#onsof/2G=Ah<?9>9Z~[)o?m{nS7[g':nu>`~do>?oEٶ]Naouyys:} =N䏯r y_]yteo3̶h׷:X$wf?IVxߖǾLcwqo:g/íoIvgWSG:-rKWy/yፂ\^pM̻(ydDسN6*VQi9fGxѧ^*g^N/mܩgmhE!K_xݿ>zzfz˃5v׸:RB9a:~2{=ޖ̇~kZûeU{w7V< |TYYWؾgRݣ+=gz.1m]m9һ:L+l$$F}losڀ]yr3`wvZG8x+ ~. ~S 3yk9[I3@*tr5X&[oǖSVBww}rY.RCn"Z['y-xjS=Y-ϽĪm쯔Y[SJl޵2O;WOҶQ¿jˢnxʮ|>/ ٙ7uuYWXWJهw",cyC[{ٖK^|yʬGp?=a֏MWq]2sGjg w ?폒g6<,n{v]f5Oe;^Kz2]uھt27_99ZUZS(QBӖ:í3҃+$U~~żJV/sn-VkL13ٙw?`N@F]wJ|Z[_,\3ei޽gmq_jD^wOˇ=+y|)b--Jd%vyT-u]z^EYߙPQ0bo~km/C/}/c^_п%ѿ%9z^nSI\#kvnv>lKw{z&aI}ɽԚa Y̓Xp8]GoGSmL[QM؃WJO\) +yRt +Ň{o9>Z]ې8!yK9)dOO{No{>o 쮨(_8ҝA)5Q[6d)b]S6]amrRg7ތ/Fvx;YE]MEN={'oè_w;{]_J|Ssjl[EGƕW|ZLe}k̊7/ߌ,hE:мO]A9:u3eioί.#hGxInWrlY`>]-g{o[s֜d$F+%F+$K-Kɣ85jM_w-;E/1JFiť+Rvl`޽My} +W7\K~+t e*YwcK/ v3/B +wmEjR4~c ]?n8oYn*T2s; F_$c%:$H[J~-\|v芪OSvw。6^g2خ7ܛY/eWV]K.iXjB1ҋ%WJOތ.Vd᎛%HS㕘+ +ƗO}eyng꫽U? *9:EIhlH9,y0u$#%%%$-6z/M?Ze(z_m(ڰ]}V-@BYg3K/]N/)RRq%tK]/9w9آyfl1%D=ȪIg~z.K\Ӳ? /)[w6ny!9mz* 07CDiශ+aI~5N2q"durxn|F:ʑ{ߝtwEĒ+c +%ވ/A:9voO'ͭ%:g>{}?Q+kqLB3fhm ^6޶\eˡ %/Xvj~kg/~u* +GڶTҲ{]s7v~Vn8\^v9rꢅ+d Ȼ6JSØ%j⟏#sol{?Udd1!U1hEH#㷹!o>ZX{%f@^u%ν+[_7o49cnF]׃wǚp~!sNgi6ګ?߃UgcI6B2{<R\3sAjxWJ(3"V|gVb _,qrAC<xUQ;m=g˩˅-;~TʗIzFdnW~zyǘjOpL4CH\4L֥fGed[T<[zBQK;n]* {/6nlGhm3Mw_3?g<Ƽyj0*LT3P&Y *&xO21~2Ҙ&Dj@kl+@/h8_R.^yK n׵ʾp6&cOc_ًwazzNӳq͙WeG7Wd5ؠW z+9&/CSJd:.GzEPg!2ϵ ]{&hpdGmXi#x|r&:͎)mށcߋ]*¾Jv}wp;o>cd$ .? )0^V@5"D~?Uͱ/& q -2]&[68GK|7?)7U6Eyǵ.py.UAk͗?=w-ry"7Gh>?8j@S8! ;dfrGBdf-Ff3M,ַ}tEH͙3$ojkM87ki^҄V=] nm~U~WW96 u٦j։yO<:|AmL@T'#3mdfO^fќh]$~ yRd>FgSh4dꎦL"?[$jE x{r洽ANy; 'M)^?3xH6q,24C:)p2ղ"7퐹Z4mŠk3LB4˵M[,7YFԈTux1rr={j/6qbk/K{^(xjm*7=lG:sNӱ\Z#襎cT}ӰEN"i&X##7ykdeFKb5hf@#Sl#ڗ=Y{P9 qϔ&Vw-ݼpfN7w3~xYVϭ{9]7{j+X_Kra-*#o1wJ{8Ƹ'{oiᄚ=Ў7r1slzkrk['ǯm|\99eeղwoK~krA˗rGnf7Pz>RJ^*~O2=^[#,p^{pM = <}'u|5]1>Ó4wdj#Ds\B -"iZW;!庳x|(Q:[U`E"iS48XS0⹑sn'Kq~e跏OW}(yꛖ~OmۯG~7ߤHe=}8s(=kw[h٥ɰ)2IVf=Xf8~:V"4}~0E=2-ڄFh4g;@ VhU28W]u]Ce[eӯy_ﯗx\/}}J;PpSɈF!'ro5_W3>dn(;m}QR|w{%ϰZOإ*Tm8 LdnZz!{99hUlC5u_)y 7J8]@u4+~(LO3RRR2ukeW% ߸F-ZMJ-ex+{'O(W b^zu=IOׇ `, ?oe{lҙ9wCTS{4V->ʯ{Vz MRT|Ko75ܫm~<)=O(n)=O!$ɇ߳eܫ~f S@PA%c81 HvZ ̞?у?z2M}#k-X*Dz3M5gk GvAݪk_s̗P8_?(#|c_@IRR~7G0eVX-%pF%lzi+,9l){c'{ Ke+ǬD;,~b>ȉn.,ή`&ߺR50j|= yzZV`D.YE祍5 4q%2ԟh<_?Pr[wzG +'93^q}~GM+=اbשxiIAe a`&MA~_qkJRa") +P߼%, JȷRqٗag#i{>ŝ|Jޝ?M(}P3J'{tYK< qXHJܳ(|W*T&Wa-KKb?7tD+oO'=xx BBߊ +} +N~,ٻ@ɡySimFd5@ jD' z-ǫؽ(.:h!ffRře 5~sj ߔf]fG48M&Չƹ}zX^+y}eq F^b( +FV;o>a'Bӧ Ǚh5~(8wPo?\'l{X8JQ{ok: VvBHB㓴#7N +)}bG~rg?H|/>uT-ɩ2vϦ==g =nTn92G:'lkq䲷M  y5]wzdwOoUWgIQsdu#zE+Mܯ+ſ)3EUxJIySN$E*OloJcNIRZ y#(/lS6>b9Z9k>Z;o +pqF0<Ȕ<ФtW`/Q0uk5h뵒~Kjؚ9Jj%~\&ޞ~%nS*>[j${!].0WfCxD0߾]WiqI^77Um;m埐MC.G4M69_44#|Qh: 6Ϝז9TϖV ElF$IUT5L.+&Ì)h1`_(?{;62̷2ItљSwn>HŵkY̡bq3l fSKeS.Eާ=rN'L;6#eQrt' (4 BNܑ: +Iؽ/Bz੓$)_[(V ILj@zcJOq$UQX$8]]HoPuvtoZ:rd[g7\ +hfn1H6~F$wײ;{]x+]NJk̖ L^/}?Lz;"wl gR>83'_%kϡsꌩɢIŠC2vy+U=x_YNUHR[ E$\7-2\W!WW@t`JF8I[&J#b5h|Qė{#> IՒ3N,f|FxV*xtFIBSudd3 fRՇfS͒4][,(:qZg@Z6g15g.B/Ennn/y؆c@0C|H&h0A/У Za*BZ/ϜAJ,ad> \~=H?Ǟ˘ ݩ=?yBOq!_XgFWf|ȟ~.>7OQ9Ia[w}ӄ9B>IG" MW6dk:,GF u~o0"A^eZ஁$ +(`a7A?;gC)S&SRt/5]-ÔЋgӪ IO^n4~ +VK5YL7^Ȕ O+z:]s+5ejf(8S nsbhꉃ35@gs `hb*\=NЧɖx@z>tJgG Ӈ X/\M5a៝Źݦ┆ /N.`t$Q!et^ uվh ۥi$J"pmXK'fiՁAI4^4Fc]WEZ,*c|PT WGeh) +g#@ 16Sb Zr{m@O,w_z*y, }#$^zzvkxc'vˠ58;2Or7]>F&9;;/5PiTwkv#.3q6#gdyC֗X?#VD͏DM.d2_{R#k\b_fI7^n?no{woq:cL`mYlV)I6͌hl`:ŋwMc̈df$:!KN(!z;ې q5ρ>|Ш҄>i*嫿XH'R* Lpy0_߻vq?Kz S t54W s {9'ޙ|Н!iju?uoITnI2Zj3ڑbkqjF6 n*:Kmڔ\4|-MFc؜Mꢰx5`vНM i<zD㺠h-m+ёi9mY#z ny2;3{~:{/Kzx6;X +>m{h:$ezua}1oLIj!.l BoCt#&<ƈq|RDzdU:kQbЅaB&&:x[g60 X\W&3=L``LmLv UmLvCfS_K'8!*We3ꍡxL tg*a:=ŀ\^`3Z24\_'dGɹP#f4 }6lyh=M痂 Ah\'Ꮮ`΀|]j75pwq-50؊3FAC +'dC$&o<]8<m'nˑ90 +KwLqb tLb82UӗCl +=tH:hɰD?{5R[fCVJ9T%)l*Kё'Τ <&zxOG7XrU";x|1HX(5d {qwk$_m(,DD޸&M'7JtG,OP +° ClX&hO_ Fbu@+ +%fRAܖv[zF Wr1ҁ~~s9X'G5h38lb1Zg(P\-o qjqh:hSF v8>"6JC&3'K4q pt c p`-!1Ҋ&+@ 8Wzu89idZw-"Q5ƠcZGk/@XSm< .s2tr$8Z +62+ٴVc4N5žPa#3A asԊ  8Ǒ̳ Dgb(BѡI/u _oL,a㲵`LǨAEl1`ƉSāV~n)Wk&ׁn"{ۉk8hm/ ¦3_dUm`J/A,|_}}zPÃ+}5& &fUYm&P#ITV!9+:$ +Oռq%Ĺ4!ф-&7O~)ha)b:Jݨg3U&r|3l.,F}˟|D xHAo9:eO֧h EW 8QT_$2u8iU]L«P1u>XjD6ϥsvta[ˌsh64QU[$9h \b4Amc|<]Yuݑ +hnv~9`J=*N =;9 l +_Kংf*`ĕH7i+Km M1B.TڐIXB%V2}Q0O_z$ֻhȚf-Dpnt`uqq&0 +-els6_zvJ{yM]!3mW=7r:uj0GМw?s M:yy"&TP(W"34Xi<~r`;.g0$VN7dɤN>Sa +Q 恶{oJѕtr$?gކ0'R/9$V㹡k/@ ]% //ZcN0!wHɐU-o%kQ!4<\.]3)ƶ^u`/.քZmWҽ7VA^Po.+yuHw\v'd6KBc l 鶡d0Co}IxLd˴٘mƍ#'# x./uLM[^wF\mړ 6Lٮ8%zzĤarCoaIA)F~2[΂&ox$~`H%VQ35l7z:(` t|5uP":"Nڐiۜh nB4ij \ ]y`a̓~" H}MY8fPv`gIᄝ%vd{WVEr1vV)aMJ)Lg?YGn|37bx8U -`sdj\; iiQ4xO\T=n| QXU1B- 3| A5vu]]'h<2]OGt;ozȏ= |._90d4:ސ+[_kᢈMu⺼[AIx&,RU, '^ \$«tx4Mz1hKw?'R|mdgU; wzV Ќg;-ȥ;KNw^!Y\"z"+rzJ)gp<#: + +c +a(fUR^d Zl Ju}ם]p ƞg `lrցA#>!;}*?u$x! MY i4IT&IH6lm5ܬ*TE@HVך\>w +?`5LH$EN ucbO+5Yxm0?q./ql |%݋ĜLE;;k:AL(PǗHUO,-yt4b8>2su^YA%O6!S =]k˵ѧTiy ̓5n;h+:00J;1zX+-n.֐ |33䤰(ז*-ol: +KP','3Isׅk) J7m7{泪W,%Cm쬢1v_TM/Xc9\yQT3dn}d|X8Jf|>ҞM}k4]pw_p *;O]c{&,-g3y @Gر#DZ/[w'+) U Ha=;@,C`..\O(  ?RgU(JvL:m +q lYa{ +f}5[y`g^I.HYC ",oMUFԢA:zh5 i<> D`su:4Dg +;pr*&|­]3Qg-P\:>Grֈ"BhAmb}ts! w ;Φ:.v~ӑrہ sQn¦޺OvV;K쬄?Y㘠h5ŵ ;>%{r`l4y>;( j\*_}l>yS%c:ǻg>Yqf͗ï}%=OV +R4~@FꄸM05?o)Ѹ& Xo1uD?Ppp䴚q5^}=$[ fӰ?7U/+ql>2|Fa~+jSg~3? -񿳳`gmRvҺvbI +wmýRyVdYA%3RߚY͓{UG+q4DxM8߼^3!V=L׵t'ka?2=Vp^\KAK=*..lAiFlXbC6,!p-;Ɨcg1u-tY A0 tqt *h,X_+m%9`++nN{a}|i×v ])MՅb0aD^m6X:Ҏpc:w!vHUsl|yfhuok?mv?p5rXu6Msl!a+ +>k@rה-bcl$(\b'A?׃EP6l<\[y<m;4_ ý9s )yP"=?8@.qL5HgHkU`SpCc(ya ׄ}' `F!lӱ|e +か"b&h6y d}C?1RpKz'=}&!GK1 _.ۮv|1# Ys+3-k9KY +*l;x7mbYo1_nIrM0zڎ];/NX󥃳dsW-sI)3P~C6\3{ǝYCU{l>'Y剅63&2N?4dѐNTk,RkT]w\[˷\vpPe1JckPm!al3\Plی֍G$#lmyn-=&dhȚ{˄\m>)_0€$>8g{|N}e簭aMDZ?Y-QZ-YM\//'j@gTM" f<68n }±׊מFXӐ~$U}w\xuGp0jp +% b.#u[a_wb 㒮PK"35%8g;L&-ʼn>h6:W'GK!|rTӀkKם{Vyk`'J +pMrK2g˫>'c M* +k|}rz|t!Mz}/I Uk;}l1uc ycl˞9i[󑜵\_>@Zj ,2zSWr IclIU灟\JQb@).+rOwr">Yz^,S~aB|^YaCAp8$1{f s\,|BaP&*{o{~ @֭w^6_s[9`% q֮ >ܛPb,>{2`-8ElF (h2*pNpoܠsZ)7b{یx/V kprFir>ab 97yi>#-ߟ\.a`rį+s +I)rt`or90?X[j u6d˫;d Vt5Q/',.zjUl~qw +ɝTXDQ j VAL86k;3M_!W:`EooCu_s/Z/A/*|L6.CKe,‡=${fp +ԑeP +,mr;=0l\p 𦤉:r}iZ_ԏ}TY57_Z+Bb +A Իp!OY.>S605uO<|| y启O Aس%+0}biz !$Mdӷ8fL<^O2MLx°_10eh7WV/!WX3y(qn1S +XΎ4 _"lg>l@˘/8BNt|ůϓĀ +aXurrDg|}tL:ηa/mn[g>]V1IMmGf~W& "9]SI\>lK=3V춦OW˦7C>G tpD[Q  }V77s_v&*MC c7 8=8%؃ }y}|t|:>Oǧt|:>Oǧt|:>Oǧt|:>Oǧt|:>Oǧc,p=Ko (dcJD^ެE)na) !V-ߏvr ɈHZd4jA s_]p"QDH؋Z[ 7a!c +?(x +-$oڸ^?Mm*>>$."܊| +j\V'z%V?6?ـfdT*~_gkod/~+ǾW}~??<4vi=c#>%gu멷-"5:,՟bV7{pXpb{{+pvgOxVZwd%RvVf"lnɊz7]?*B&J| +Q  SDxM||H$Y"ӄIId$2[S!%; к^ۃCtJ"I5@"7@!D&WEl IT +%J /E#%KQD(ǯ!FG +T U MFgVO $E~T͇Y[=ԤWfcB1eNyq4]J:4I] +֠ Zgb4>.GhZ ZD<7}*u=M5%d7U C"25УL+T(i*V=ЇE$k%o3:z&L4i@ӋւKdKU| + 12eٵi(Va6iV9ݳзLj@4r,EsSMelJ-~QgDǫ,K48rZȾrSj@ "N(؏O;tPޢP +ܠ,TBT|2Nbub>KU,S5_~UЉeKrmIhh @U$ j FЏn5 KR瑋ClH&_3KfƕJU`>*RԼyo +h#qP:#OTg"5euqyMerIL`/~Ʋ^+FU#ʨ0bӴ4M)KA"BtAZwN[caӵGhu1i`Afl=yr<4B}Р`B6j!AjLXљfsu?Sb}|J42Gh7C,Ƙfo/ۃmWg#4@CBm#zKk,5q:lB69F7[ )Ft/GVC_$;=$x,=^l[?.>[d q'rƓF"c5s.HGGz8`D oTu&cXS!7(c(ՈMDa*BJ@迲㠟+M?x!D]f|ͥ6qQZby йfiLLcڠ_ $6&ctCD&a?.P#K>I\e(֑dhAo"Ƅ މLM岷3{<>ڄǁWR* h6N"49z'z["/k#vb|޹2 s<zusd3bc2C;،<zaI?3BuS7UFrir9x-cUCzQI]%C`Jwͬ~AkoV7Mi=oNBR.akz$ь\7 xl6NK}sL +'X%V{3>AӀ9Й ?M( mыF~ +$OÒ5$HU?D *}fI5:"Nz}Ȇ25<-Ʌ z`ctp܂+'Ps/DWZmEҔC vD,VU +}8QTp:}]U{#d1ڠ M.K Z(+ﱆ>h`[| O<*t~?OҶAE٤,l,/&+K(m%:|l>E-F&j>0< 7^WIҍ|F$!f0 fC/B"?DK`QpN0UZudm8  !;y;,AzX$%וa7-;gֳl,yv%e +s zR}У'=廱T&S+L< TkA +I㷞 #?zUqaC62A)\h&4"%Vz!Agt@Ar2]+4M0^j +TD_ ZVseGl\X})5s2:tj"Uc#TVlp-q‰@l:eqy:w GXs6 bϠ5c~nZ BQB|Tf)r;Cɒ:d,ˆ)aEo23 s(ٌtUFg +I_$0/AaހCtNIt@!^Ȃ6=m@4#6 Z"gMm,賄Uҏm (@4\4Ұ/ۗ~Дecl4]r {|b+H6ZmH4{)EzԆL} =xaLzA,X4h| x/p|_\Uۺ6>-vw' Ұ֚ +;FB>xswZlswcqϔsx- 7ރ\Fx=nl*[<5z?Z5cCneOLA6YʉngsX.N?_ZqD Gm\ե 0FeAS +ErĦtb/{E,'GAV4#YφpហuXqϳbmQ0^|½AW&3g&#,| +\4!- ч=@Wq\74F{yFlj +Z1tо>Wb@우p, 6raF9/{-*a/KӠ$@&EF|1Zq, Qqx/c6`MHM~ \zf-=Bn,ǀ7Ħx?=&ڢMR*:h1:19?8|t[hй~kSbX t!,MW _. Xd5u@źX|}p,87 @蕽 qU7;ִ{ \ ^蟻r"[ ~16B9n=@-|85i1]|j{+hPӠw-:K"Si%QM]4OD5b Y_*q\Qb +xƀ<5kL]13X;[Xy3oKՏx{y_^fhΟu9Q<(rKR$/DS| endstream endobj 37 0 obj <>stream +R>hf 4X?q#+3,Υ;F@\ G?ǿ+bGvx4XxMBsQaLv6cBB ScZO91&cnN+D#EznYj60y~Y߇ɘC5Uxp7f9J7ʙЛvllSDѤAWfz(؀'Ϝ=ÂGMGhm}|4wi4 IgpxBp"1GV0p K"'뱟gt|2UOk8 zok` | +`JWOBhp|^QЗ4{3vy5k8zX"(@;{ý.ɕXrac1@s <):ťd?x{,)GAGtH=(λDJ(VcB c߃_=&܆=&P(nV=7w>hA_Kqܝ yWɔ%:K} -=PWx9>|e7"R +V `;V-WT3_>xz<PLu8/_}:m*[hNmm}qpiOGi=&4iB["vc5O<k{%:➵@ab_y0':+f&vc +zyX4h6^GuWuTl]۰"B+e($/کGgt;'ύd\cva ğa!+:+>K;}([DŽ˰DŽ_=&MD'e0ޅ5aT=lt.N36b+΃^M*uP"K .5oÜ/0t`sSYˡ\/xXY)kWK:\Oԅ< uU=BYEP7 ؓx=p'\=,>~F1||A-GKõSՙmbTp:`&^N@&c;5DpZV?=&.`[A_|kh>QaM}< xH >5R|)xֶ=K!WA<za;) +0/ +)bϤŠ,yѪ'ڢ ^U8ƕ+J+y䪃lTv Lv&h:C}TߜUÚ_ /eQf%JRX㡎;Mt߼Wx) AZ/q ;ek϶}o8xo0VtB^ab +RBT(B+ k7"LhCmd.9*d|/L9C̥lL^6Z 8m%XF)J;dwhIKn +逧khy2d:yo2AMG0F# Pa@e15!Ћ"=M>-J|z\]yi_|)D*-x?فoϵ^U2pxxLqzHHr%m?w4 p@}\㸇<5+ފ$FUSom;x/=~ӡl`*zEr3R&SeK-;(ɨ^$ +vbOH(Z}# +ab f"d o4Qe_s=mD|T^g|30\ =/[B1>1!z|$?K\RX&W+u(Ú OO^Z*ZxABkZ뱕Jfu:h&^= +ziPGݪ:+yTsAJ-}:8;%.mv:M]A̓د'By R#Ijf9?W,r aT웷F✱քb_7X4W r[MDG__* +~ns{ C?k?C־}iB!:$N(cx9XyOk􄄱%ZJ5*,f `JGS@@m| z; p5iI'7)EwW<`^X s}^ +W.䞸ЁOvOum*%?;O#qc ?B.BBy1b🦬"gRa{ahY`Lj9(QzaE=c2pDu+Џޫ{%pS|B=S#^Fuaz4 +֩`}ֆG{n +x_9Ax u9p}GC5XrpF8恗j%. ľW^S|E䒾 LOƗo.#ga#3ߊCA߻ȨMoTg'CV=X >{ax^Ff=k pW26/ ߇x)wFÁ"|XR-L/pIYJDX9KATp>m>g]'x)YNz~ 7x+Rn|# w Bq}haoŇ80o/w-YZ=>&_BB-s1 )ʽx-zX!^2 Q\fa=u ;|d(&qĸ+d$ZRx1p:sa31GV5bL|p=@B~6)R}|MNO>O؋W;Z*l? n茶dV +B Ytg2b0&ܗFs8JX+~ owAn؆=`7 +nӀ8tdV:WCXKx!`er"]|zY)K^lgĆex>?7/(}µ}3 I|='^ O79;zK|ó3&8'Y_r=aS0!0 z>ʱao.2 9})lp{9j*>g؃t=Qh1G%/? N,[kKcK웷 /ڎ1+00y|}r`}aT/q^pN ^ו7 +>=qetx 25!XwGBP=R*1/u; EA6@? >h; yCy:TP; +cZ!;p:$hVdd.߅ u/IE5mtf!*i/!J܃jvðVy<-5Gs po&}*r7흹{G@Qށ'LZ*W -#aeBl/GdlgחЩD-:෎\pX< ׫ +wUqX옾a/!=ɐsxc +Ō*2 +]ֱre4>i6풳(B^tٯ˿UUCz͐*x`kȬOAUv_UuQUgc1Lzv%UtCgٔf8Rt84N-bK߱eLC+ڽП2ڽ%9'l{m&֯$wu8繴VE_=PqhlhvD*xC@&!7 +03ۿ {{1mlQ)wrWqUE)dPD?_4>?mxDQǓרJ1)-QJ?]$+]mDIj"+&,1:9-s0 ֎:GFss`6!i1a~z'Ee Q{JN{aȻ_u NgD[Œ#FEN5AJ^2GJsLcn5aF& +;!6u(*!QF(AcPKjQ5 2"?g }_٣CԦn}ԡ|cHg}(ԋՇ㢼âvP¼Faaa̓3WAW]g-xLPw#WR\^mgEoHVKk:L 876`+\W>?J6u@ER#6CwH𴄵Pb+Jsѽ^CanT|S$n$iaZ(Wd}, +:t;% +EyH6Qz(ګ,KCQ#y-߁noYэ"* :~Ɏ1@Q{?iWcQwEICb‚ޓF˦sm:#㼊Ӈ_X?*߯Y_T׻Ҽ>? tQҗ^߮>jxV +|NTe!2;m8Jf(xEH}2f*z%ޒw> +;{c=A&w#3>هbq^1{e۵.aVQ1o +36c@_:_5ɻu[$'PT~.z}kVtge_`Q/L^z'Bf)n4x&j +r:Δj|ia^r>iСF^k8#\ +UuWvI$ŕL_׫1Ao}W'o̐Oi~oʂoECҬ6^IiqaywnFeu$[DNUOQc4&.@WC>Ÿ́$.@=2F:*~;u&zdj4\[uTrPn1C>y/%6SQaYq~ǝ&:A/T\Ue'uT{|7t ۪|xac29^Sd;(֔h ۣ=':nHG_F1Mּװ%[2ٽZoo w4lH;4لTԵ ]%U'Yn "m r%y/*4*؜Q^\Y*i+:.pi +IjkrάqȮsY7ҫ7owƘ>egƒgM$/%ŵϚNZiFc/fv{n͉?z5ټZ[ɒZ_oAݏdOu95mW?mxCiԑ(S})@8Ey-zP'3)_U׺i7ZXuQ(nd߻KCğ*CϝҁP۞w>=)*;%my% 6xZz5Qc܍;s+ں-<&=^}DIuhQUȫfb::Y]x.w.Q.QɕQ1OAzP?l,?( 13*+u3j* 0, id*QQIqEq/H=Rj#RK"f5;׾1OD–fWSJP.,6/ m >қePShޖ,xv5Wq> 8/u}Vu1"=dgNcSZ[sEXqZ\Vo%zd%Qzŵ_oo[eHsMHlR{_"55s'X[^e+));$:7jpI ~t[ݹlS[}H&/mo:W:߫ /i +Mmr>{7Ew y߹KONFOjcc"3K##-#5Dl͎~(2}!,y im>uZ5i)<גz5;1^D,Zӛ5*VxvIN̠uXXk W^qZY߶=Yk4]!inr&?DT_YؐfظZ(Ӟ[qt9CXkhsBL r ~p{勣N'֎lYS8".m19v/ѡ62%+15֦96U[/llvf:mE .sMIN56ձ 7ܢq +jC9yt2̤(ڴ'7bkR_os]X⩎+tW0޼q[ccc]c=Z}vT7[^=g[jڥ;[+(gF)~FkuW_LZk{7K\#4嬲jࡖKQr{_Nm;gyV&ǘ!Ol#rl#Z=Ua;"\R36kT ѕ73X^gVwڭBtZ?ur>mӳ%"W #r|b1 +c.#b;u4||b1b1Uf.1{1rBazbĪU6}swլC/=:5P%;"|ܨmD7aoJ +mCuOt.OtNHzskD+1aB= ~L5Ե\nlPMUV242g]PJL&cQH9 +],Ay$ze"Fdk/V7=;a[DDsȈBBW"cҋ<"G+p|QWK]47:G<(q|Sn]~~n!r-:U+B[p O+Dq8?tV2*`l&tW w`1f4u21Zf2i1{Zb#A9 C#QGfmc # +2߸EfuD9&,!Խ*0Ó8GŎw:EĖzDudE +mgoulyo;w`[i +gk4:C~(⦣j|uz#'xBsqSo,՛jA8SYhUZ%%=isԓט'%Nq:EDt~U'¥*$&':+* +JNIQ+nʦ62o'fL18s28#q4z {p^>':ML'Xnjn&ȩ{䔸Fjˌ>lޔ x%^>M]d􉎜x=sx%uVX*$%֤?7 1 #kp?ΌGwhcqhG-&q7c+1_n+1g~b2Ub}b>1g>!?OH!i{&)6߿p {qKw"͢bJ#Όq޽s/v,.qD;,HfɖݨN XFsblbĜiyI;ÌZD[Lz,yUbC hbc$n?wԤԀg~e_%&!}c`}@m`}b]c`Rd6՘OmO8\` 7 ;=7a1gjB~zWr֡3}/!?c/1s~|mW󗈉N4}G +Ꙧ˭QLs7 8tUlDc7aʛ[yrIb3b~+b LřXhM,P!~Q%V‰2|ڧ(=V pDž=ŎK +C=Ny#9 +8CPOes|l v)nٜ9Z>c-zDlKQ_"rsE K܈ (/$ +MENK9KuÉE:2;<'-Vi>-|q6-(U@U\ѵ8=-_c6~6>1-Gu" c\2ǡњL4s1SB~&"~Q&)hP",TAB(gy9{ys 䕈+hbJUb p<&:$=P?GmҶm4I6O%q10˙ 2Gyb(8siK>x1r_H}׹ϸ's+&m;{r|+)qss/%5GNX1p"oZGV9%սs#ث89~rO@c'"֩[+)kbi(>o:77 ?jgm~4Nvv1ݫ&x̭;PU-Q +lSVsZ@ipBwRmL8`lCch}BCz-B*@\EKVRYV"+,'Bl[̮@1O5@5 iOdn[#v>js>m3c?ی!_9#ޏ7^NxȿlvdJԽ?eDϿn+H2>q qa9[(egu!0Ӧ]fhd)b5A=dIwX"VU%VT#nI;/<˦d/VT48>ΘѴf+o߬jq졬j&պm)8W ϲZ#}ϢMz^F>vVwDP$VXUn^4h#.e!m'm1 6&v.ʞs*q䮰j?8>7t^3[?QkJwNO3IrGO=:=ѡZǩ.4ݜ?w;]]f7u݉Мly'QW_`bB_l4R>~ڧmjڃy1/;z;NӷsNC9J7wN|ۭ\mQTu[ׇGT8VF8^BEŞKnCn +NM3p?j/trJf2[vjD?b1eȐk:Q[θ_ۘM:ȄU`70y-qKIoE^9lC5)c'/B:]mc\by^8V% ؂W '],?puo +ӯD9MF0KUңƄoS{T7[XRTr jWMh(wQ;V)+zMu,]v{gR6vU'3e]G ^﫝NQ?g~z8Uk?\wAa.y +Uv3.zMt˚?g=$1k1c,ܨG(;MUmj~GWj7'k1);48EIЧ)(xLMA%UBmBWQ2fY!皽*lPOBA'c˷y+i߻+{+D魚&Y56|7k4 oҺu{U$9Cߕ)[ȧCaK{/g.vj\ΙwPߴiVt]|cT y~FJJMعl B2a$6=rq-JmgSI{`q#s>{ - rз`_75^LAԍk6Q6Iqm,~jƠ63K }J/w~;co׾mU+vprb!NG~i J9V/zsiᳲĮ ;vzuhD0c:DX@|ҖK䙳Y=dr>7v#@P_yp OEXpbmtR#JW)}֖3秴=o,-æ /xEOjOgW;EBD6G2Us&Yr U%tM.E=vsCWӤO( ,<Σ$xڠaxTuKU AF"92d:h:?6³lNY1Q^DpФ; :2iCSjdՂGkߴ $uvqht4ns[tjRT#%,bTU-o +uHB+iJk{ʨ{_"DRYs\S_[I\C3mEދ>(?* "J7gO\SIRzGg]lyfb5a.2_sw~JV?T U4+ߨ1]]˖pzU~=sfg|E P[bflf .L}cJb6w DZ,hI.-v2*GCtN$|P/d[|:_ {vZbRv(!<]P! DugɇyTY׾~ْv aA)|'ӖIRIk͕|NOտV1O Bѽ4 S<]+؎]OQޭBTAV2]phfn1s|Lq-´CTj f?v4 k$^J=qO_zw1)~aZEsfWQf.|-byuP~%䧶Nա?2:ʬ($!Bp N@TOUbąw ;tC7hh>g{wg538c/5F5tH%U3״WLfv.0ӫ^)܌\n'4'wspᩙ=bf]Wq~t]Fx}tcފ'es {l̕Y{<ˠ+IBn4bۋ͆ ]|.n 7b7ySibr8>z,?w:m9N߼~4 +h'}mw77Sg..ok-~nO|}gnpUyzU}V/yS+oŷݽ kh߭qټ_sPh9KmD4sl4siW]K+0g8z}`oE_V/kDc%i_4Fo*FxK/׵>Xw7ϼn6p.7sOpO짵^}aP?;qwxpVx{WA? +,&n +" +lp}u :#1|fF#P;# c- +س[NC,ȶ +G =,_` BjGV_]u~E~K8x;/~}GOO:i軟o7Z=Nřoߌl6~L-x|Jh}tPqi~._vA70+O͚+5˜fk6]ٲrfϞ==Ylcq4]4ݽ5Gh¿`FZsN|dNﯗz{_@ɵ*犧{W`b)e +43_kO ՗pg/n{LhW7ktp7ssB}ݥ=luLL+o9]h}(ْuІeXoZAb|͖u4v`~S#j酆O]/:jF!fNdCE.9RfYM[NՕ{g:Q`OŋI42?"]cV 7 ŧfe]S7\9,ZTK.;hRGpH1kXvu!w/hbW9-s#slЎ ѷ?D3uo-w} ,=>5oߏr5"a6khOE9Q0F7M7o;u'ۅ|.?vA LghN:--whgNKܵCu&͞-]j5:^SAǤjC,$$+>I>u5&5LPCRF(R!$Ƙ;[lZO೚'eóާۅ;s*O/ E9X'\x =]ۿ +GϢ[g~ ?)s'quōfI_Xx.a,]اku%Wf듛ǹxj6,_qv@'X_:1Ȝ4?ISHTK7ņ˄oqwIct;y:xsX{c9~ɿ Cm*9IE炵;'"N9͓IS'Ճ,/)f7O&-|t ]`Gz;o-?kr!#5`U֘ޞT~m\r>`h|;)s*֋_wi7ۤXlҰN~OzuPR/ R "Լs?.z;77VsY=WӧW2br&̏Cڑ:C\Z8l>YÅt':UsCHcҾЦ +fk9AJnt5Ed&Xj,o@JR;OҸ QfB]ﳭl=nJlp#qwp+>^a<_~VaBp;ETObkwp.x ;4ȊQBġܠ/Lї]O<\uېnd|1ec+!i4UxctaC!cΟ]7 ͸'pEf!k,/D+ RjqlĚBbP7V, nq@(s1 \o.\7;!w VQ5sZ>x!1p44\?SK__P#@38P,rjhπ ³:?g7_z^nL\()m:n=bѹ9Z5@bl(44,O>$k}xH> wJxzhnߧ9#kD+}tġ$Dځ}B!^hCCص!hqВI?{piғ岾yr%R~aw*bO=p/}$=u#= +v+c |QuVz|M,׳D].Іٺdƍt[8xĆhsC^ohĀkhON /V%Sۆ|.տtTZ[#\V?6 E@^d9e;+ĺq>jr=YպCQ玔C#Kf>3Nd.Qdj$}H,% t +9h 8dbN@J-.#>8,^a.&к4c} ,xw .Zp~&n#4YԷ(&pR"}D 318ub2O,I i]`$]0|Ig#g:brOoY)`b!GfؠO-Ln-$TBGp)0Q*M/t)5\_Ew5 vzл'z'}#iC6kTZrO^FcN5!e&nМuė%gM{s֓‹츰\%ʜ N"p-ܼ$VlNiz^r2g +Uc-U'9u`S@lЧbQ-$u? -fMq_n&[ oMھ Sֆ rr}4]=Hvw8N`2͡wé|Zޤ1JIHSCvɵo] VO|Ilt k5|+8 ja,p Boh:HO8R?aIJ%C 'X܅OCml[?-Еn,۞nnV8jgAHn1O3;S)_~wr>C'{BTR23@XN9G˝{q7>{Uz@?J~ CNj]r67PNrx`uHO/LL6q7/ѷ@zBqLqO}j>ԎOlpb*é^˶=[vh'Ʌ-0N5buVAV`T7-ґشlZ}?(y)Ё,uPSmg^߅_+-:AK c9*@'],DKQVYǦs:9ǧy8K~fcD܄7ZdyʉH-mĀ+9uNS{6[ӆ_JwW7 }OHgk- /8u?l;=H|F<ΘPxj;Ef c"ِ3j?9s*i=٭z5/YQhhl+ĞĶ{>gA'=%/vz^ƴR+{ګ.CoߡG`/&0[Kˠu'CܫˋF\.tj]V%64Nf?t$avCב1*/4T^]i,/%TUb(-Ŏ;תI zG8~ggq'X^vo@T!s!~"4PY'C,BXxc冏7]}+-ww;~lr0|H!6{_X{rt+o۟EC]y7iqu5 Qz>BZܨ)`5jhQ:pXn_b/:g޹ ^G$YD?5K==% Wf5¶tR9|^c37Rz)̇77e*=r|#4.P`׫Zvc9tԱ8ɡ_048\g|}ycgk9|ǫm|ǫ+;P,xpnp[wke7_wkP +1|,sا:>{_mf^WC^ 1Bp"qb+ǂ;1 B3lrX.7yO9X >q;w}7c:\` H[V/EXpsq  v`$k4msGѡ2H*783ƮBlb Mrwk-nlp>w>۟}^tq1q' DZ~>3o߁uRw{Eb6q2Z7;Kv_w>r%;XĶ϶K7ϰ,=r׋=dlkHs=-ȧxORH1|yC=r+Wp>\'1Xujxsp/tuW(tk .jV"$W;A\|qYEھfgU\{54hY%FiY|p^K梁.CR@E#0k#XH|h.4|&hzH-.^oFɅr%hq\: 92 3Eɡ&-nL:`>C2h<{#lL}Tb|sFFgؙY 'JI`g5^$ n!ɶ&EzYA#]3[k,X-q[C1 KCnth2/dU -#gpgLf5[f\2poo]wT7>Cw;םzto+1 M5}7Sl>,mPn'w̋3ӃVpz\Frz?4kg*f'a=R8XIEc՜醤: kB=cy2{y5'vNRY!&zy5{,#>RGBm )6JP98u$|4Xħn6OSmwt0~H>yr}M76(5)u0go+X( 9)zJhms#*읅~ { GGsіrb1bkvV]r襼fg!* `rzxe`gY&v~/r`5.4#Uȁs 3g4٘Y;Ir@bo&L롷Gu͆61k4nߒӋ }X C?{AGX,v V9:0]+u5^rAP;S5`bKguB.)Gxk4<baH`,l:rb"[`K΃=f&5Y}:@N!Ʃ`+Y!Yp|TW^]BO05X^b9kD,4aJFd؇kS?z軞m r=QQ08h<Ƀ2G{<9x\NrB~.zNs,<1Y +=\7qd|x!XW-ß2j98o?w^ v4#Rltgg%uvRws_2F7{o{Ij饾s}oMxIf8. iكW@lIrZ-˽NE[?*w+t|oyo= e񹤆wVCKղ+K%U{MM*'DXmY6Mjl+r0ղ&%;v{ AF}@,Q|pmH?5; %0T=O:LͫJ=Y=DixwR+Q8+5!YCfb@!!v'Rͅ%jWI{3GKq%![wg~XA.8fA156OC/#Ծ m ƷWC`H=6`٭w|[?WV(VMSġb1yj`! & +<,@s'`þ0cf07uCĦ+cmB}EGll E/w>cN}?@ ā.))=}!:RBûփe8T vXsvf>Rv4hY sY`U쳤}&y*0co[߈AV -)d~‰k:KgE=5_44OmN:Fb%x1`\(uunϪ<;p>{R˯/76O#KP<QoNwb5Wʭny_-%dk|<pP[CRnߞ{ĒI\g7̶ #A_r0fZ݅O\483&g?9Ge+BF fKJ% {TL>r0ħQzg-2+Q'YMs.#^Pj%1P ) PmV!' ng]{MeLw{R4ԋ_bσ]o^+kE) yXd(' ;Kl궼irU7~ZY/&N+M)>gJY6oc]-c=3`T C]9@Ll&6,Գ<?pC.@ )F*V<ܡ{:n;칫חӹɔG:럄_p`}.V=Yٽd]y8&dTͧf%af.y}n~`z1\eN5Bp\‰?C_Փ#tXw)s%bUX|#`ќeыC"TZ!V]^^>beb-QR|~QhLଡY2ZY=LEjyPrqFjc-i 7T\^{~x\3л{3\˵CmCqVJRx|i8 |%B;}u6jbyr>Y+/B%T0c7ws-.i1ЎbRȥ±db(p=!;cogN4*,+ f#Ū Ee Cx8{& ub{k9b]8멞Z_K:vrV\1^%xO8@q+޴^X|!( +g2 H;b'τ1!8i|kƙxo-W*,B{|bb P|rxk=3J1?ԒK8!Ff*)X6qR>:Ku`?-OLBMYA^^݅eG[ f{QV{l3Ex {U"|o>O`J5=\:pbWO2G:{^#](|c?=;>7YM{:,vv3[> 8;ql)Gns\ǔ;%Cs+j ps 'ײ84QfVeԼWtmv ا2030e\i&CNT1ϙ=t3zk1*Fd؀)F(3$yó0C#Ԕ*TfT|%IVs xSJLxAI'21|fz|i/GiG6A< Y)*Նliv͔8#GeتoCARP;#$nzB#9 >Ɖ1'2"6Nәx8Jn8Ѧ#VV=bKMSsV,l)I3;c " }DN(^f?}N≁ +0<'RϦ?99:!8K[̮S#^˝P']M:\~f.λ! b}Q-!cťʋˈ >tk6i"1 }6{i|31Bb מvwJC/= $k̇ cn8=,,`toZVכǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛǛϏyFsq[_$>(~ +=Qq)Λ%mfS|WZyB77 +ϋ]|Z 煦+.4$4}Qd-il ^r,_zH|ykVnX/_M//?|a{>~E΢`%>t-\C#6+/ U>{Cvf{=Z邲1δgXkX.^[k\%'ni5ԇ=.>HykXXpy"[T+! dtZdK_>3t;؟ZbQ?pG +5S!ebH"cN cԕdz#r0L-G*b8zqLCAL`?k`<'鶐K+1292Ӗ$(؟JX"i|?F'X + q';BDɴ#iTkFyCB`F +16,YC*[I?Bq>4# HpI6Ngg?:VͨZd陉Qd5LH}yf?cqGǒQVt%p:EH(vI)uNBHHCd[Q$yb2'ɚtM0:sb +Fp|C7܂!m16d|ͼfުK:&H$x9~:%B>)Has@RȺ +E\hP _, }`|Z(6bdPvvRui!92NδcrD1 4Q0 +t$٫cn[nebG ^0{xf- )¹EeҨIj!cP2F +KI${e#RddӝHWV`͐hc,r8{j0󃞲C4!lQ$|7g@nrb`ţ !f$>FĆqRHgY + +vQ=h5&;SF*avz5B2?m٩ɵ qjdbQTcj)s2jhT gǖ>Hv $yYfEZbKͅ4k!4ݐ~Vˆ5E\1Z.$Vdu yW9Bm> F+ ɵb-!A2, jx-$2l0t2lKg'=e7O,i$TK#~Ƣ4*~|)/蜩etH +}ԊK3 IchlrMU+G)u!B2d2@k(dTJ!k]cd2úBrm3>I&!wG4cDB&CJ,ؐ"ϤJ"Lǘ)O2[t!b4c] f_!+H`gB8f$sa# Y<Ƙ?Q{HECgO?2OvMX`U ^xi+hm76r˅7 iki|1AJk$}kdTZ)K ?nOP/.뮮h8]YI?v_XbQM?1Ř?0 +~G;l $ʗJ p{|lSkq=Kv*߰HL85fqM  Q9v?%)(ܯ1 +|ɍ8`IɿX@KN_2!%v(#'9΂4G\Y +YlYe6ԒgR^1H QH@yH#Ё>_lhυ'gC^ecR;gJזbXc/$k$dm0 +A9RL|*d;h<׶aj-IV2[d}s|`3-^**ie^5a?HjŐҋ -$2'^3N.93Ozk $IzC#48S3;'Yst bl=Zc9rRz&3269vqd,V >  l;9ډ:_PjC1_fH7BI>>y5ސ[`| [aGbr~ oQ}Y_d_)`L 4C, )V7R.bIVRIl&hd``M?EݳHP@֜:dX=X;(LlHJNYaQdVC['|c֣t>qRG+$!kc``ґ1@G:ct[j $xo/s0sC}gg!&\F) R\h'enXc-))ͅXC2ZVd,ћ +xKoJhz 7$t)4c$$ \V{<< [i}eLn~uן{un&S,}$ 7R*G.0 +=R` ȱY7ΪG'AFИrQjt-O5t S o5EYd 9NXn ) *Ɠe1  `gJV$\8/z$YPv)dd@מy|'5- Ŗ:FP x 2;4q B>j H5hk$ւz}X~Vִ~^ +6sl%SȐqD l-4p8s$jVx|5>rJ[C::9%|S~G,i1%|',)Q/2}Ȩ;X|(##H|fd5.$ӯ~qZ`5Qy錄1oB[KшE| ݐHA +{vzJe'cNLߐ +f5[AiɇBT;BPeR6]o<=C5z!$Y79|m>J*~&?RM^ExǖO7JwVCP/X 1X"‰O7Hu2'!?BGBv\hbl;I9U0G/$?)w>-s\IŕiKIK@9S~̞J%ROֻ{5e.zM:+)p$ÒF"PPs g6ݣσ~S !1fN (c*/#AOIȸ˱Uc>׉Rhwt5 yG䡆#EԫT3z̨7yd9\bz$]?d| ;fpml՝?O;?o5}YHr#õ" ws'(?LTn4飇t"'QH/eRXu7nH`1cI&!2?I5T)d-n>Iܡ^ζS X00Hg6! c1IJaKѱ诊IEc NxK3 r5ח'uOA.8!U\["t}S<`?qQNo,6z]Rq,1ڑc1/9EXJ}V6 $(Wk'uwY!OtdQU[[HR,N|sf9'Qu`!ؽs\LB7B{᯼9q7}Ǜ ʮy ŃYXjİam=@:r*ԏ$*3Ob WL)?H;>MzuH=R" y(2ѧZTCRi"G6-wrdXԳȱAP $30ÇccGB+ NBI!HN ļ =v;D8b~B#d  +j+s% srCXh9YgCLl Ixyo焌e[k$Av:gW{ԡ}pm%,;{4 Hj2)wؙ.Q.Uu}DLB_C IY? +{ &LGzk7Y||;"I1#!Fc6h QH*j4ZOCi&+U\Yl_CJ9czHajhV!'?I~YX]nd IC}NO{m!*UZAl;U-c`kpmh.}G2!~N8m;b2lH&Yw +,PX"Gj"< fbȄ/VYT~}1pQ&Wnc >P7͒0)ԍEd-Dz|)@bDY=J4M,ؚ$Y@#c`_/j @TbJō`Lhb …kr6i]z|s!!V !weP>턾dp"fwۤrGg}HȦ^ye(OrɵM2É#)`k ?hf. ?ClL(ǙVHSX3aϓ+K !dđFBt?ܭ>rқ'FBd3CWG~$H8B:01($mgMܮ ;Kv]?T*N{UO(TJȵ֯J~a"iXlG jj؀<8h'ICKy[~39@=ڏp_>t>Agf׶ TkՅ<^ͰeQ~!u@/u9@2q5/*q]Hֳn_ؚZ$6^n5S'H QCg45''}(+38 +J` ;>$ oSZJ~9'z@t5\-y&dqOo6ɍL}Ԃ6g죒U5y!}z ؓPqc\DjxVG '?䑆@VaB뤬i\dd1Ojoe>>F;G; 7 rtu*m{Or?ȁlk3p!!j.p !R~GBď4rHc[ӱ 5 S 8 1$yzmZΠEXIIg. +W^AMrθwΆJ /y/Rk[0 ]HooCK:9SPƞk$HH?+CqvJ%Cs?bͅؼFBm϶.2P}n!nwڳKw֪P|:=Vnn˝= ލuѹ\[V%W ,%Uqyb(7>} +JwJvҎO@݀z=> J7K g_B%BjD!Αp. G3avDdy[/dы~;V兆+ˍE(9R>5P:-~3`z.kp* !ԃ@gͳ % WWL)NwKR=ÀDn|hI)uDCýJgL5;i8qaoz} +GpO-O?>(zhq7G}4@Y/{ܹ6OCRմ7a,X͖V7\3MYys߸  X;Ӵ?7?R3tńHGuTBԂ(4!!o$YoH`@^3XJߥ.RTt?w = nX܏V0I9 +5CN>UZ{KCR5|qNtH =/wY>E +,ΫQvF DF*\R0䐱we8 )kK '0lأ +8+<5`4g( >=WP @gʫ$ ەR˩YSQ>ɵbsGHw#-7|A~)UR}z bkXuy1B7{?\H)CH]5LDN.=AB~}Žз~X9>(c62M,08hBZ 5qj/NZm(ujڲb;ԎJ=BW`XS}w`pGI"B?s@&>PhH_r9k*bTqz! .O9g6GgacuA V3Y,G=Y'<,>B68gJ,@?6`:F=p?k/>@Y 3S:,ce@ 7`P!(pVA-rs7`2G%W"GQאL9|jF<3[^!iZ~z1@8"g=tT:U0 +g qFm7g zJ,3g`ή4O +dݵ$+=ϔ7K}kbpltП)o;~{M>>2a&+,Pvf19p])=?i[CF9:ߞ E۩,<(~/ԭ襖[@F%.9pvoaV_[T\]{=k:}L__3 ΦL諒|:gH%cɏfh @?\=sO]wcRe8S?u&0w\@8ʉՎbt3c*#%9galmSU3{ [k ]}e)"l8/z8#h0&9j,Jg%S5ֻ\za1,i+bk`e';ʙ7"TM/ŠIgCsmq}4oL}@%zK:h 􌹨,[.$q`Jb_nZ~:cl.!_Q3h'Kjo2]cS= RBӽ @R=|+D} P]V+G-00H,2"KmHO:'we A xI~!sE(._2gu!IĘxc5zWͣ qQLʟX<㻿.4ZGV@a_4 U Iz5^] ̷2?MC,fYD9-0_XDg;ĒY^/bOJh&y0~V@;ma1k=0QY}=o\ +3}7~optp6Ы +xKv_uV5B1'1cT|z.Aѩ߈. D>~A34{f7gD$W_ey;+)?,-V^]g9kj.~,9I;5k;_=uW?=͗ேkIɿypCytGzy'ϢķWI͟n-gLC_ήk#[ wVJvO>)zq=wJ';OPdjkx;mjNKC{+v} &xWD~HО۹ԗj^~E|G`r`gjٹKO< +vw +Ͻy亾ކ ;`3v|gG?^h/}zٮo{wW|O;"H!W|=.>.<+׽┫+?|OWrO7jCdxqڣ2S9ag7+J@!ᬁxMj=Wt'` 3:4_zKJ>=n}/> +*i%0J di}{)1;RQJG <p[ =(|V?Mr 'grEf{>Y}O= ܟ?WOߕ/%9V\;㽻Y_Vw~S[_Go~{Qp~{7v/|J7Jg2k&)v-'7`6 >x[/o>o$KYzC'!oП])V+]F=.ًOO_}.~+~IoT/Tõǁ~?;\'}j+ {͉﯄]Ƅ\WدmzO>gbcWN>;g~e-jֽ]*$M4R/(ki;PTR(Pw7 {}39g{_כ\ISsd%9H 7zM͏&\ѐz:@?(^݂m,RvKAGk̂{_M_9Uͱ_i󬸲U㒂Z)nBsbX/>J> 9KA_`y̜J[+ZUFP7oϪDw{$5tV(C]3AVԥ;+YvVF4h_D<*&~o(`@di rh +v8{`6樰s0zřG ~󑌔EXߕ麑(n +}v7GTwH4~ZE}Ge/[N +:$ -_9[<,;)[/rS;wz .߅К1~'R/Ukcv^M"lrq/.l3h<"yb/,{EH<oNEGȧR E?{oE:B}!"+Nvx6of—_hY 骼$y_$r#} +D޵ nz^,fAmN#j6ɕ>9[(}$n׺M]^+hBa/E_m>4Y{p>?{I"!pPHm7mdsY-lO?0&DuN0/EW].HV;>z$In%#f$|_5vG 9ŝ#ҷ%.f%>ő*\InDM\ʀ!n]'Lj! +fE |*Tџ>SџZApeđ\ى갤 oÿy"}'7+;$Bn'؟[刍05!y`^\)}q~7OzVgpqe^TyZRR"0{sAT~VAA\zzmKhXc/ySqR\\{<3˽! ˜%D]́ުH`]=~IJt~pTBP9V񋭰=$Te Q-px'%pwWF5ѳ[ՎUIA^YAKL= ŞR[ћMŏ;D[aM|_eMX-md[{CA}=l_&5gՠ9Uyj6{k="hͩIIZG;s͆"ɑ~a/~7A?Qj" aCʐ!m(v -e|N6.ҪHfXb4U]*,nh +-[214a(H\de*޾VlfeA(QqQ^rG`髚Ե6V}ﱮDhs)! mę|zi@$cm2;NW\v_C{FڭMoa]DPmx=Ժe<2¿{Hˉ+_͟4<îq(_Ϗ[/|vv?K:q@] +idW' %˺ş~ di1auxQ}iz[x9û8w1Fߏw\gV&%6\JkH=Ӟj{/Q&Z3*j tkFxG1y& ;a֣"Kܕ3bc }:0MBIz!RO(ݎ}7Txҏ-9j c6`oe'#)z%K+DF*c[SSR|䁍aDSROKTK 1- Wd 17j~%ݡ=/;f>(|_7V#w ƻqѲ,޺EU>վ񁵡Oo" ͋X%c4"!K^+Se~-%abEZO +s˃6am_$ 5!^L]y y0.x@DmM8y3|¢XHm)FTtPy$c]"OjݨsAGA{#8N/d/ʼO< *8~j{__z筷e{l[|g}dOyɲKlz`,A5&DS=:Zȑ6(ο)$QG/o9{fĒsQ[\e-qmUaﵡ(Z ~u4zhp#&vP:h~Fq@ vj`}`v q;<tO*&F˳2:6bEAY7 `p5GN*ü(92(%]<7> r Z~cQtvwKߞ:Gt9r$6l,V`.P>_=f60{Wi^,:of)L``zxVj.L1chagw5yw,b;we1o*]zĦU&$T/ֆF LŎ,BbLˁ'2s[ktbC۹8- W?U ].O13(tafmش\o.\X +0L0d:*MK ;L~h%s&h&mcx__瑢uO({jfⅺwqYoeɠ_ZS=JoDzgodb=b2|jØ^/].i =֝9z-M>¦``@⤢A@ Ct+-[L0eۥ +@ϟ+`Rb_'7z[2oٽwn1jCA O>N a tJhJe8̎VB;Tm4<+Ehlz֠D=0V +'QO̩km`` 0#'Q6УEqob->&EGMܢqT@UD͇o=c Jd򲀸]9q/oIuFĴ{rcƿe1X8a:lG3D'6M + +5ۭh75:7՜a0(}_n,֮#?\\eM1Ʊb/vܐ/};3=V,=[n 2rFw7L#ڨgUŋ9`9ߧnN/r=[28k'o&>.JWOۗ |"Kd>5QA Cv+6?9ٮxky 뷃Y˞isl+vk~Z(hv +sxD0LUY ++-u]sEðcWP=В2TW+.>oKʗ˽ca3uJm[ `~!<5zެ} n_*vb{fq>?=Og[DzoƔ``[*7u>٦nԩٻKhɌk(M)/Nhc\7+#;h}SJFɦ0};'jtCm瘎1l';[BJ l*3ڴܼ<(֋}Tͨ,J{V#_Q 󨎍CoMxﲄZ?uHJh͊v;~zC%iL|o|wi 20Yy)L̜VV|lx¼E qQ ⏕f/]A FA9[emboӹ=6;caC 426J_Ӊ+6YfNfO fw@= ̘o&X0U:Ϭv3vD:e 'sJZόZJTTwiU3'+A>RWY*ß&QDO9З,ӕWku`ڄ`܃`JzT6:SqOhT/S28 IE>boy[ +Oyi[oR7П,GǗȴ47z>>Q]e1 iV0wV0k~0gf-YKy@}]AuFQ`GDw1ؼG2'`jo`srƷ^qoK<`e]G#l c]Oa=29DZd0]q&5n%5u3s?XNV<oQ0gY10sLWgm'u>0zAƪ̰!q_M1^C3q=qU>PᙂrRd6kOfsf?c{?ߛߝ +f_fMX UC߼ +̘ο]`^LS϶mJs0w,`VwvEN(dVj19CP셿Ob3JJd47zduyft5DPv#o6♪,+$8Lc8j¶m3fm mfo6;EZ`'*< lz7*M@9H11obaU3qe]wy[3ɱ:=&=TӔԁEM=NO{+?c7~[X(X,˴.`y0_ǂfwuNx̬1޷b>Z, u@vQw<"g[ŰNhrc!E_^и,5kÿ˕\ 0z)X6~!Kb@ڦOS۷_}#<3A,\g6KyX0#q[bFNgED +_V'+I{:OCUi~?׉c3ϟ%?spù6 ,4O09b0wNSrXQk9a`=![?U=aCfs@alQ0Ph{Wi/ɏXy7fVUqJ.dM'׶b3S:?Ƴ9x _NSsp>Ut,&%`~|1 `#i9ĜZ >8՚,CQծJ=b++bk=/m^jG ?c9ON]1N Xa ֺW^n[ߍp*m i-y61۝FY=pY>C;Y53B.FdЂS}b,YPraU%xD z~ro>@;),YKEv̐_`Vh@6הv7Lڛ;O-MمߞЦr6BVi.k*+'PL:#f3O~a?F/%~F} Z18m%/d%~]wFaa4|| $Gv7NTC4M{h=41`_֘%;.`?? k`Zr.X۱PgudV1چMc}iFso?\:J?׵k3[M*!5eN}x`2^}(8/g$GNԚ5 i#//إ"`l`Μ`SY.9+tꁷj nj}zZj׻hsp>3|+cM~7e5g>ʸ1T1֜?v<`L!]דuߖiJ?v*gH*dMf|2 e}ڦ{6uU{:M6_}XN܋`+'`ԡƿ2?X٭YlctL~g4b52XK_bmO%CU1^p7pˇ& QE-;@(uXVj\詴%DFa3<ws5G6l<0g,cM^ nV4Ž]jKwƞ @_`*3.gLx͌pq5aqɺ q3 +j~!g~s8…mxg}%H؄E=_Ni0/KJ,߄ҏ{,dL2~i2TWƭdM{]_4L3NZm`j#8vSy {o}v-'Kf~su}qԍ_1d[ד#o"V?yN1ǩsOV>;08Ɛm Z;y +Ec̻صBIBKW2i'}G$~fO貢Jڏ+Ls }r+u,/Fs/Z +c B +Vx1`-a~fN1f_y0_Fo087uؾk8Q17/j-:ّ&O0Տ덂^3yhp_1Nff^̓弇?IoS씒`cJ,' 3-{k8׭N'AቋMTOMkr +,JzŸv(6s XCvJC4fk>gj73 e?ߚ-_Ģq {,9.nlT{QFF`.@ +H'Wn=/t\$ZX% +ۄI3唼rYN!}[b^Y }x.|/;XNAL^Mrcљ iٵ1eZ5r{n>xYc< ʸy ɭ6P106`7fhyuOr:b`ǘv, v/cl`򢭢WMG'ݔ &LdAcc +Q%KwdDfFE®v~Np!^WfF-2 ͜Njո׿[b9wLT\fC&k+>%B"4GXI Yf+p066yŸ*/%/"}yz'G*k|_UyI +}[4~9u/*Pi LCWnM):mA~Ŀ|Ň~fH&3iaؗOVP&L@LA m4y+IJ|s;̤7~K+aW+ȋwV r$TBn-b:ڃA\guk {'W?jKPi[U鍿k +}3+`OFH w2{KqA72; OZ=a䖵dkyۉxIz-G#J,JC\_p4JSI)Rx=:_Q9v=/5 _Bj׿>ݘP ?wKNd!cúm׫Y}y] '.n|٪٭7p az#a3cl\q^2Fe }GȷrUSG5wkmBB3a&韽BK >[O^M,+]䐡® kiAf^zXA VwygӦn/F:_U3SŎ+]1ZA?5I,úi| ޽qY1WhI*8'/NSa[x$ݒDt S9ƒ5VR,zk Ln?gHiu1h] ~G,h5wT#//E@)/:_uL|?he byѸ!1gAcgC&!o/FJϏ2y!W"'%;k.ԼLn@l3byBm.E$jb9h8} +6< M8;!HizmHCxoz%s!.dHĿf0ބPTB'MG̪H+=^?t7R=!V})X3q| tI;?Jp(Sʘ͹QYe -wzlؙIx" qb fX2m4v(1aĕ^=5$΅N#Չ&mR['>vuwc̟W! =hńavoy!s!r#~{Vh6Ʃ}慾X"8#녭{@s>0[+}cc._NTk`+3E;О<ɥ(y>U e2"DZg|cPq 3j\zARVAgv?.ұ('#?pk=DFqۈ鰼[nf>_@P-& IGc߭g}݃w,<>B3]BL,r,2t#?o7'lYXٸ`_О0<~C'jre t+qk~e-?JaXZ^݂ x*k Qqq^ E􊝉EY-9b]~'뎆S*9_=x+* L%po\&X3Hi} Fe~\e1ш%dL:"UvB9O62}\9@y磦Q" 5z$8e꜇9]Y@z&bY.c~YNÕcThĚGAJpu'x{TUtSZ#0Ȟ)ϴ9h?j naWaaF>8Dv6b!auQ9&dA|)!vPCD5;0 v0l39 P33K߅#?bG +pY+a#ڀ0k.+قcG:Hр:<))/gPb>s#0;̷:4;H1Dy[>YƵweY0VZىV/JTvqVopzWiGY?oQ™"B> V1ڋa$ț;}"G1@|1;s0p1A墺ZH ˍ ]1ڸONaf EL1D:OF {cAX|YBh1  +p٫͈=ApX'X c3aF!S^(y(o$n.AA5".F6qE|q%<9ɟu + +Ʀ4Uh#8@qH *zF0!`_C!t-N)# .aY*br:({z{ J {ܭ'ވY}cg;6TvˣcMk#]EQhboՓh_>cʞDRCտOlHmMػf'05b:qcG,9ȳEpL=uN4Mg +9($kОZ{KơIs;>]H+0͟+(ǰicX¬H_ՂEz/~gN 3?S1a$qE$􍄍i2C> w 3g5l? 3S#,g7s(Gh[TAENA{EBX(#Vm,Z'Ga vE Jr-" +=bԩ+Ka~qˍDF`˼iv">gm?u6Q#eِ9*ފb9ݒ.8q\ s ˎ(N10>%NMFkUk T# 4]+v&o}NE qP2>0ٱ<br#4"?nuFER-Oӈ+D&;|FŘHwGpC EV [6'nsLq1YJh_ Ѐ2(Vc80;=Tt\uC}b`ͣ v,vt4RgqL wV%.XJ8MExReuTQHo*3rDqX}6ħ]bb QuڈSiUY 'ܵi!P4) ؗ둟}}.@zW8OCSdZ("ޱ)&RYF ùY)!\WJ|5a{FȄ]dZk(c35]ІڏvMò벛鵻Q͋4кټ$Qv-2z?>A~HkH: n܇8hM/\[B7k#|:euZ{$,Ddhsxf9(VO*߅4[;򿾄սpw(Lj#.2S|NF| ,Z~q*j +pquMa t׹aAhY$Ҍv') X1VABIhFiِ")"7,28N~UβQ|E>v[]<&k>/,G+Q)+H/9Ryb--Zx.Sw;) fu"y}2p5n$p=2;46΍euyIȼUFUE 64c';RWrTt,òQMvЛs#ޓ0K[^u bKXxĥ;q +'T o"Ek+PElqg5Cd["C/NבEQ0-7jq.dL*b\t ũRZA#: 1S$-NMfOI 2j88Hˆ,l+6}xMDDKXS$®hHWZ=(yRy}Dz(@Oe},ҜCӑ>iкG@;AfuD':@OU>Ps$*(.Y'C"jعEN|{2 b".7Wf(|dCacvaq+Ge-+) ɣ-9?Ib=iLYKQ˴2/,i@8NA:HgFh4VXmcInեf͏{NB*KYKbq.:Juf OęHeq\a#?p]o]iPtHY,Y!7l%XYF!~cOV+ն99iS,6{>?#K;K|No?1|^Qm iͣψV(f,@DKٸF򒤆tF.=S +~ ]| A _C>*JA\]*S10y,|vʪj ]7D:WѪbXZ"6η9X4Q\d5qјP#\(U\es>9 +"z5H(=s\t݄ +}vV΂DO\ȸvy,`<&I ,(+{Z&6 { Ue`cDN(#}&f/,n4:N\ܢf/孤cvR_sQ"`t6vV<2RNH;K +x\g4tݐ^CbsΚX^_Y6ncEQϷJ}axyTNj#6هr ]f@gj^2KsGi"m<0v5Btҕ?uO)#D?w^& @xz6G H>*ڄrIą< `bLcCJאREH嬶);nDk]SjVzr қGYt$em'V;@!jbG)fǜǛMD(8H d:({)@Dj95KO%Cs3^ FQ|=ʩ'ȨDH9FˑU J-l*G f̢bckmN ND@E9KEΈ9E(Qَ_x{~78J(9{Z{9}2GZ>jN:$f +p'7,YT$yM=XJ򠝥m(i!{ǀjSﮦYJ'C;+\g,Y;{VrЎ)~oo@ L+QVO\t>t%ʉkH_Ob@HEWF(vry WyW/"c 9]`OLX6k ~ICQGDAE -NL^2xsEqH)z +|)$q[?%>2O~+yEJao&tޖ[E.,v tùCokJRVvS}kg|wRKCW@3G~{퟈8[&ԯeȻ94)uK3K*m2ZٺtW9!h>f0OrYF;YM? /}؃jaSp֑;4Rltx:|}>t1eܱЮ݃a8&b}.<>ǥT7&@EǕtjriRpHbٱ;s]X?^]s`hҎT%jݫŠ􅸲 X`ireoKNKfE _p& 5Z1q~=1*SG@>O9:]*lLyV5|>Pt6 {~HBS}Oc$kTg5Oa l9p/Ffo?q*:)lA}S)4XCEb(pj~(!XXN B4qQ©On-Vĺ +㡋.ljЖ hPp/uRyMU ]:Sc'kQȒXǘn}.f\ȭY,VVtCSGUF˚5SvBPJ SN\/"4YBم\#h|ep5߇f 0saF;tU6jGUH9~Xs=HLh׮J*JkRJ>5zvޓf7w$k#$t6\DHEs3{? ٷ'Z0 +w|$A}(wK*3Z2~iz +|]FlU20Bz4kP FuN(FC 9R<BTx:S K>GH?0ClIL<2T}[.ś}`01d.RDĨF戏+QsFCZH|'a`&c*Mr4}c\Uϑ{Os#$vE]O9>5 X睯41'<Ί,m#s*2X"Nмo B:z2v|&wu1%|Yh*qTՆ&vO>X6N9%\qxQ8H^\{.%EM ?9syw#wU잺U$Zs/Ɛ$@}lÓhΜwu蛡grb a{8G-̊`CKBŰ=q]l텨K|\ٍjyc'@ +&QY 9M9@rYԢ8hm~ggsI'9+=CGkbTB`,tPF/ve֬!j3ӤСVc tUMR& czGZ(o2${+86{ꈻ҇a_wDyY6ry?R9\?KՓ94o 棘5T/CsFA˺0_m%^B hC +yݕtmNy/b,ޟs ¡SYoױh"g + kcSwcÍӊ֘ShNE kgxEb40Moyy3b4?r~RO0\>б$X-{_ +BAk p9#gu 2 ^^љ#TQHB9v_NxjBC=n(nYQ#|@tkST-z3n0{Z#G\ }c ƟdEPΣk:$vv珢뀨G`p@H FEw(vb&m}td%[M8?pO 0(V>=+W_[uz6)MIJ +}yx^H!hG_zhRyޭE Ћʹ>&[0pCV=^p"15=Z" +=<6Ir~X{ޔۗ_ܕ8D/'>h4󑜉p/mjd[h&wq߁ irﱗGGB<<xzZgK3{70pX/s;GRttS86yfAә cbP>얀}s_D}ٹT5C13SbQg'sLE]83I4ͼ4L_Z$$ IĠ +ayP'DJ &>X}t7KMEGʰN?y0}H99?8] B[+eH4.%I55KS;H9?]xf*9x^_D5unϲM}ύ#Eɬî#cgA>=v|;ߎoǷv|;ߎoǷv|;ߎoǷv|;ߎoǷv|;ߎoǷ`-klvrt Vn\hE~پSDjJkmw8m_8MkOdci5jT8w۩3K̚@͛_z::8n#OZڸi^#y\hYHsf-`xZ0ob}<Ok^ǛUݦkDT}Օw~kV3i\eG.?<=Em}>yZT9+Ƀۅotȗs?·`Hq"Oҟ;GX_T߂[]F?|y6|/_~_@>}.-ǟ50#]`Eu}6ld,cl렅YTnܶ} Fnch$2,{SfCfbN3CkJSf u ͣqk`JANEwQ%]\ջ`j[d'| [aR;hVE[--4⡃fI4Dv=@n!62B +G +OJr197AAk)f)lƁh\o) y2l,%nH#T(@^q?=wLAEcq|PwWtnG2y>m6ueܦ BZ=% I7S2A)"$;4i1n A  65ffaLb@&e ޅUoc5l1h]ez䞒Av& ec6{뀔Ĭ6L ROCKAچj)c]¶Akd? suWtغHp [ٝUwg{HN!}DVAi6sSJ iPJ +IJ7ûpCQ"7rFKKĴ AI#ͻ7%(Jx%А-䏅[Ty*=*㇂Ml2 fAprfmPK>gP?4GY_MɏBFLN*an1dDl_ᰭ;g2 ћA P.&ܕ'Ѡ%4DL=)^Y7jAҐ`,d,=ЦĞXU>$Tn[@D9XZ4;EdKƍ6ڻ%xfֺGc,X2ߔ;[2rMĈӈiS2]dv3@Dm "5>f-Yn \CxޖJOm|7\-:'4!jA !'٧W&k[JďZuJީÔ %׀Oo4٪|x[4q@/B@2>}J<0T7M$pg0:NBҹhD9lEr_AA|/a(SS>0U$hG} 񟚆dⓉD6ܒ}{61MM3ѴDoQ{#~Y3a#f ?_s$Kw5PF3\*&KӸX56E FDHV9~< !DGNjhVDKPH/m%61KP*CI Ơ OL.z a-*Hp +K#π}xspA/`WLM ȩd +x ORzȔZ?P'Yf㤭s펦n#ScmbzA؋q>lLa&f-4ц-pr 8\[d?qg)0d⎤ ,ܸf=#\D49[{t%x%\_!91$S@o4[J1%А } ]@8Fa%FەJUQh87?{L$` Ȓ=R±MR)E]AٻІ42-=t+|҆0@IhT[B/&v@ 7CdU&%4܊ gf⌫h84pP1xo@ScH?1`A:6PKhܣ6Tx{T}1Wm޻A"ׂBnNo+%< x[rnI\p +\jGw~oFOA\r~AS&?@02];Aد{t?Jpn9r;ov[L?jMOv;txKi+Vu z1o%M ~Q(4ZѠNI \)\XzzGzXD0aHhj !R ,(ߜo`;!% $8'MMyEv N6h$6GX̡Z>1%b}4&M2_1/ADˈ{'%@6CѦ\ڀ Gmܑ) | +AjK|Ϥ͢h -ZJl  Err/} -K>M =-0]4NR$63q0%s;uNX[@ 02Lj?$ Cs?y{O<⽿X~4f@b)b_ p.)`HqgtcoڌKlTI>v% @~d.T d4paţ)gdz}h|79 EރXbxX> 4Vsdza p~ A-T@z*EVOçACpo3$݂Du m ]:>L0YXn*$W漫ɿdFЄ=|m== ôq726i"~2D9h%2n.0w d CX<"O lh% p2z#Fb$*7-`RPLE_O`;RP; Q" 'WKJI*Wѷ7d|兏B$@z~aDÇW؊א5 HB$f7F"r<gI|H|2_ LףM8D0%t!y_EH4$rYhs=O`*@b,HrXg2|z(H<`ߞ8h7\Ea $BkE˂w y `Dgg - r[3~%^%q.w.ѝƃq>=@ F k 6n諰n|]ܦmnB>| +Mf rJJKt1nBIA8-zE- J!/i\U3ZˢgK@I`dvyX|yW`Op@9 xߤpP:j($ D. In}?%!g v)+\` jr 9IAW(w0kÎ +{5DUӳJ29_]UjA O)i{kJ=\ۃ]ww"^CtB^_GlVxpEc(68 ># hvGv[h5&d.HąG3s5g@-x><)̐bF?T '[̥ dڜ4fV`ۍfv{:H墧6HANy(ޝ1cQ$^whԅ ;H*ld^]H @^ `<5掾s"`#3TQV̀ЎM9;3H|6_[aՒHEIR0X$$_)y<"~gXN}(Hk@K " q7`^885C/YO雮! LIrlEqOTiW 3)Et81r2PjEUT2|y k!BGKlν||@CѿK?SX4ai\v +iPXD,2FWBG#/D D\K}C?5O0˺DƠ06iubWST`iW/ 9'ɟ@F&{yPOc $o:v@N*+^[ ᗁwP!=lG@[rZcPos@qKP/&+Cۣh$Ԩzg@)y+p;#QR(Aqd򂻋?*|4U[ IZ˂l8c?A9BգiM5zd}Se@"-Z +$_jJ/SGh~%~P 4<<BB[p_{'P5JT6D 93:!ˮ݃P_vE 9?>B4vʙYJx!N %WpY ?p#. +#̳s!LGLp"1ϋr}1~%[شLQl}D# $J R: K8 [`GJԇ즃|C8Ipj_)IF`-```a#~藧w 5Fs/@-̦^%ĝ&{T0/OCL3G$٦ #[d$|zcMHKZ+$@kzd)EB0=lxEzd_.x^ ۻ# FRpg8sMI)9?Kǁ\VVHC +}I^G-%ȱpn24[m@r4o"!Bk kMCN/$ȻK6KMG TۓRF>v +/ȹ9\ɬ{R4Ԯm$?Nٯ8MsIA!76$fN&yhC +YR~*jc@t^eؕ{}uR|7cl~ZeQl|GE)u*L漫_JJvfQ/%yFhk yu>tn!XM6+"GlѓIwK@?u>,7 + 1_xqX/䌦 !xAƖ֝&|/BPgbBiZpMU(+]8{`q{sDwm䩭!u%?a8 _B@ endstream endobj 38 0 obj <>stream +@ązI3S"דi2[#QCD><>aZ_rG-W)\㈘ dr_-hHzwٹPAp8]TsDD~Ħ P]*v[x]$i_ h &*g08{FΤ!tO7>8O89M$?ImX?94ɍ WJxl:,$/WlCEӵĂ1 /ϦT0#vʅ́thF.2p͛h؅13jSXqoI} \؅}@/ aȃE]x_HINgDx*4D?rgC3fJE7R=<57-eWr$ĸ>b+:r~m.?{uL-eQԂطѿ'/]yR= Qr"=@Zq~I0_LL8? ++{ջƛknӡ_upD Wᰓ!-2--~Ne\e_] H)|}nH5e]G(:*%8=l66PT>ėǖN7(+[,Lي ?P 2O7`  3[X1& :**vY؅WQ[!:iQ5aټKx;i se LJ6T}X~`X8zBr47%#*9M#!N +dK;b\Xq.y!w5/;R>-$GkM3כ3]dK-.QòT@Xɣ'Þ/(իOri\TZ˸P"}?!m'~ϳT" ،b>_.vRRó  ښ%O +=!XS;JP=Qk+nKwiW0J=`5!bUh>wbHA,=?;n*m3B4: ~ }e|WҨ] j?yo}㟅WbSSE+XQl )C[кL"yɇg)FNbzh~qd:$vн=c»˄|ij +/jlyX!uxGE9\̩IlG% +1M.$`:ͱ!ʉ|n2ar/[y,}{&?%MN#G6Cta:[8J,L5K[u7sbA8|&Z֋L  ^Gc.TƝk@Aد j!|kvP Pb|7rBB͡5H;NSnL<5{:4d 3vf|0@#j]:8j+ƵbnOo?8:M5{*IסqJ>yT@pq|3)ob nL=Xh2>2SB \}wHAM# E0a]TKrSå- +Ε:Y>V>gb{@sqQ ߤ!4JQ0]Dj.쳋 hAWz| T +ˑ<%% +4?)m[5AOFCZ1`5tAX }ϫ[!gn}5!a-9:ji$G7)l_sSmbJ6,Χx8Hk"_ۓR_R4$lYjػ!k6QT wm}U#Gu LňєkG[=?$. + ?=]Z1kBT`kX_!cb9<"Z֠ޢW&ɣLSχ"[_OQj.Oꨛ +7pd*FI ڌz&LI/^5ZiʙNA^ ͞)$Ϡ{t1L)AXo:]:XֆP^)D+0 GpwuGOGC5>9# jZ2L=F?0 {9S3V4BUVl9ݣ-b +;/EԷ#'98G>Q{`JHh:W!vz25ǥ%/oY^`15 {"4BKg*DueE +LQ +B}&TEՅ+siXnL4N΀й24ws'b5B;c!d`e$g *L +2йuTȻsA| qQXĚG>ƘuE-r:g1%GTҡUBJ!|4nt=^Mq6^9[QK=<ISQ0'{HE~ bRb©[YcbK u.5S{Z>jX;3xAԏB kͰ3sX,@/OE'揅=WP^޶[P_31?AV@Lۙ6^+]ԶğKB)Sd\^@O MEΆaa+:ȫ:VEG>+zIWҺ4د|CSVL -omE{bX_:/j؏fZV(+jZ"Hu{%QS5{tP4e@NFڿwP*RMo*4(MїwG1&r쩷uڒ6jmA}= >t vcp1H^eI|,p1Rq=A +R+s5 k$b*=gAJ0U-(.o]cUDCЄӱ/)L>"Y|3'wr:A xIBh>|%{r_@A[xy~]CNc@kXº#jQc)~"LQg6Bn"nXSF=K2b[0a9ˊ|i#1pwRL  !Jc \L8CYq2I"4.*;LE-˨ݧ"EQݏ$f-:*ɏ-F#ŝΧMk>b([OE,PrڦCi_R^?X=\wPοh}`[ֹJh3;7 9qhȧ]JqHĸ3EUL,5(.$?`CưʣN72DZſWWoՆne ~u|bx޹ީjå [{^.7.W>R\NVel>PcwmnX yGu]J6 7^;I5~-h釮9[!xWVVtp॥tV["P3:L2S}$9`gu +&[l-[x=a!j۱;p^{pߺsw~qTV +[mܕlj KmcodlǍΟ`>p'^gt͆?sO/V UOMUg`ߪ {9{pN;m~3d+N=}P\ybof{?|ʍkx᩸ANߊed‰vٶk^E[!}lIw[4u+Z~5㮿SM'1?g2iR_Np)UfZ©J]R<^ǥay#ɮ`-RveKŒUUrNw}jm;rH(V?3XeX=7LH +;FߴXvO3y_B?_ [rEJjSV˳3n}q8[ᯡһ'_WKo:/v]h_h'c +Vw[U:koؓ܅WtǺ&Ym5O+6*4Y7ތ{)>vʼR˄yM,w9ѪWSUSWw׭Xi/Ց})@ܘfL-^}5ߙæ^zHq/[]۩]uNyJuX wS?W/7ʓmgc|H>ǏBUm m^tz~遢/O۽+~x'uGM>w|Pw2yн<߫(l֒]ɍxյ63~YKl.~TvؠYVo+?N}sFDMmAh!Y{Gd(ڽ:y8W!Ezߞl僯M?ˊ^Eu/FrEf,٥9x>;_`1Ch ^6^ec"WUv볕广.VppOdMo^= Řlyy>[|T`~/M+7ߗ2hkGe^Y]xna}D~bˆEN*O~y,|LNOgۼ;a[͎m5wWSS?LSv_ј{C)$@ܪLYiȹHzSWpem}p/d5)gZϖ_(W>bëKIh;['G>N**i ˋ~T쨉etyO֒Vۼ;'%<1D]q>8\oVl]|v͹9ߜ߼dw.}Q^lqQ^mqW~Kogxˏ]o/c]x-qoW~DQ<[ŃUʚ(o7';]fW֙ZhRӝdoy}%xռ=xATfI<٤yZ\w<,ΓE^m{[yяS23+BGfxVۺ+n_zM> |Rku d ʬ Jso)ϵz-UД`Z_<,wY(NKܙxfa'3Ҿ,wwV}S-YxͿ||8M\~x.,^A52_-śM.ÛRJwhڻlۻqv/n}u,ߎGwjIv|7cߴȼ+k0,.<;!1Wfim``微‰tfWvO5-wldwZ=dV+ޭdN;֝-jlzXPH]fZY~𯆖E͋e~]ǝ+ +m^%.O[K|w5oͩ[^k.*|8ȽD~*IcmI yCՇ38yՇ+5!yk=VFf9=۟%~HE57;]}->Rݣ uM ƴĺ"P]]N[J~Ww7:g'Yľw;sS|b|zkѲƤI?=\aTR'=8C2ԅfo +ȼ^XafoW?vb|JPcf^b܂Yw#rR}][9Nl/.Kx_ڔQYU Eκ קs];w6E?I(>+^x.[]&F'>.ٔ7(e5]+-^M!9>!&\Mputmbk[E|?g;ώD>J.:~;T}~`aG S_s/2%f ']Y^M|փԏm?]"$)dcG]^/gm νv_}?+-DaGC"jitkI`ʀ[ݵXRb~Xe,X3h*fޢ̜?13`,2e˃ 8?hmտN]kg!{fq+>;F\vHuĜZo^gl޲x煦>ꁫDfh}f|w=f,njf0ߑ>~Z0VF)@k*\{24h43I^5cj}njό52?z3urf;jw ~4nd/Kqkpww"so ʸSq?½؆Ģ;ѹG蘆f܏ZOo۰ܦ6])d.ܰt?gm:8зbqq={Կ-4<ӵ0ɤD}1L_ӛCOÙ0f}fbsgtޗ,8f][z_YkrU1Bl{-~pnLcR~#/fUފ>W~?0coMxKCodܺQ0<;>:}gR+_;}|=Ei_Z:$nsf&Ogf̜¬O0rZG?m@?Ӌ0?r]_7F3U!A~Ҧ#ם̙'2?*.λιs/&+Vl[QY{oFfufs2y&T}nH֝ڀ o/_~Ց{৻rBr62ʉ2r +qn=Yiѫ%i7?ZjJ]gAkV0fĠ̬[5эzHL|=ѹ@^Ȭ[7C2*DdU ">&ݠ<7Ӣ65%WJF{H_\d_=M~azAkJ,n0w/Wn>8gfEakuM3е&Z!ٶRcl寮<ٹ׮,Klcw;6xZd[!tK j y00ST@~Ӌ.]]w[jb "#5j}#_=ioZ8` ^>z=27s ?y/$ͰWsJOMIͮ'yW]PmHfqmdo]^u-Z}dJ{?ٳ1#PM?ڜN?_{sO3\//fDf5̔E6Z뚻ydla5.Yȇ[ʲːWG5e8vWC3fonI`]ayN Vz3rN|_j{;Ӈܡ>:{5Uヴ\ko:c-qf:Ywku]lj4φ=9;e5/+4 满mK6= ʹv'4g[aمw>v).W2tй:˘ z@8x3nb3_*Se_Z_>r%*;7 + / )t+,Ь[Q꠺,<듳H|W4D:jXe4}uh6=gn_~ׇ/7ff@7=2NCOEbXf3DfP ̴ҭuVͿLpĄкSmՇ+.mjc._YJ| 0^[oۼ3ӧ=3.u'hdFhJ5^`kˀ>Х!?0Ç-f/da ;ed&,^k.G#I{Ӏ͎_*$=7* +{{/raBm +.mo, .B޵k;`3'? O(K2úOa =o3bfօ0n 2_2Vx}=8j|։1n=Ww;Ap޽[!youӫ|(ήf__W чz_EH/$8\g<QC00#Ǧ2Xˌ`ƌ`Ɍh 6n#3z24Jc~ ]qkrp,[n:w+TMYvnMGoBAYodݾEQKS&_JbuO;^5sE#aZ#}0#fF1d&RxfA7rwݺyiSoߦOdYo_×d\s c8>LF2͠c5ѝؠ3:fL@fX_f07fhOff"2ٱLmzl0tmlzҳZMO*߹ɥn{v`7^?üo}kI}N Wfoؒs!ه$i3ɇ+3t;˙ACB|&gd>l8ؕ1F8N1ckl;3c)%Ϊfa߆jʠ`|tEƍ6lJy׵E^.٪kco R_\5LEI׆x \?Wol!%Ͳ18 7NYQd,fK83n3j)Hpi䁘71l)3zLc U̮zano ݿ2|gR6J}_pCmߜhRUsu O{v~wcK񃦎[r6};~Ǎ-Y㹙󱡱?3+[џA/I2N4fh?y9ɏϛ.~Q?2LD>a’]hk^ XX|za晾K1a?R6$?]Í)OvlF=ԮW~|yO?vQ +[}fMc9>Ù3c1Ӽ|63!tZf1Ӿ32Ϛ(`6弚gY+w~֕>n۬8caCg 7Lz`{d`_4O !3&,8}$w.Ӱ]!( xOeOȰr]1_8C\A<̄tU234̜&..18.@aފ;km2CSo1ZliMeݶZ?s/Fw +fr֚8q!iv}G\63IŌ81=irfw3}i 3e.LLL/3Zg,̹f?x5>46r?Z͏+տ[sש^M;hpӠT|nT 㷉ғWFh[[5?|Y+|>3nN3+qʘ|>8tadA4[bs5e4+՞^?T~t?"?* xed_|Ws_-CD,P>m~S`KGSthk2#bĆZeyZiaKm`f45sKf i0 _ "}5hW<5,re#U6U|ds MwKKla-!Tʐ̾G{ +8mp 5v`G}\W,Mڄr)gaSoãչ݃Ldیւ6MHEr~dfnp /VHKWC/?"_2p [Cn78-xr옣۹X!K'T;{~>|'>??k0_8~?HsVwZ^Oj߄JmV]ĺ?O=C^}{Nq ZeIb?LhRGcFOcfd3.qM]^r?F1,&I}ѰԻ`K/<ŧ_~up'ŷOJ_^5( V$2UI3Wo=+zR.=y<6GaòL; 5.^z/]x.]{fFоxp_{~~_)u}V',uv$fL2 FncpѐLVI./%/JoՋpjt⵷YOwE>Zm~՗>4*.;l<7^oG_GelW 3$~ _~z?Cn1Xeb矲zI@ +3z\Mzvi7!qmf ,nvyTGe5߾Tۣo/4ޟy _"Kӊ%h<)|V$zr1>2Zd]\R>C}+}o<߫汅-C]#;K7w?<;r /*\5n6SvrPIT$fI>+?0L r|$WYyp䟋# |Cow5 +a$.8,6:|mxyKUa̢Ù%xLxpa+s5}-}2OGޟ-³w}!.:^k=Ļ4מp{k4M}g_Ht7>[e`>%yڳ~&{[8Evr 8aXjߖe Xĕ4=|8z{1a ɖQ9#+O,O§/co?J}/C`kOgkOtƒC]sq<5 /0W1)fe+E/<οU[?=3Nn~`3}O Z-2gƓA7Nvsq z0ίW;/Mg^魚CƖW9;N ~z:_WfVՐNYaO0K(`os[_ggmV.aPhT49;Wc,< \ƄhM" R Òs7 |3BS_?zZVv:r5_+=j9l.Wm=i%YM sznS5\vSyܰ2po |y1Šzg}dn h a ~9$'%x1 'bV0@0SЄETab~p\[zh+,&XYs/*8 E-CCY u |-[yt:w_~bݝ/JRzpZlPqph~/zeTۃ5F>@=O¾}ӄåƁRAp!o;rU]0U޸s|D*Ձ_?,WB8 ]{,_y> +6uVnj}"N{v2;oU^0(?2xn~j@+c_!80I@m*<׌ 4U7YN>}}7̛@) pŰ$S}zvGs|MW2qso0 Gu+9 ۆe]xingyt>?qώ'{n\)>Px$n[7ײЏ^ܱoczy*m(E >LcO.OkӍFlV;՚z[̘>@R7Ͱɸ/^ɸ/Z)(XqX\_gƓs>-]Z[99=R=ݩڣ\ln nTo\#cեsV5^i={5^!t:ٛŪcN RGб=2hO5Gƨ9v d+0.~Sj[WϥcW^cG0_a5&Bq"q3Wp3E(n!fn37 s6;[HUvoAЁ77J++utho7˭P#eH }?=\ŧk,.)OCCӱ^hfQ_dT199Aɦ\dZfƒYFZc+$YB+ KmzՌɶM JZ7A\E>NpBf9`롻k1Ta/I%Gu'&N|ř†H0IjA[TkS^pV6p ̒"o&@a>KU\gKf=3f)?_t|ztNO, ?II4U2#cM)Z5%å-.co/&4\}=ϗBGAHY |ù·ݯ\ptP{4< ,VuɋH+E\>Gu\5OW>/?5 (>B!#_8H<6|2}+B[?.ЂK);Hr)\ۭBC_)}zPWߪѧ?]6}@e[^RUӧT?/B l[7nϻfrGsc7_vv^̜ 3ic33g3+Wd|$7Hb|Sx*ex h zZOÍ9=\1Տvyt% n.J7V<4Pw+Vw;KEĒ>`5ϵ\ܾƷ[k(qV>W8:H>2B}o^ٺS]:_88Jo}#eX)V:|,fy+ohD :0QvS2讁C^3A +zEC~x80R(ږ/)vfw>^H{?|!z+I ֝!|_(_~?]9"'7k/UvS V6gKFqUY| +VFaMC0sT\aA!Y+1K.dV.&vb<ֆLZk'ZSLAI/f|VTsv*>3iGg[hc]t~mb :/ﻊU=0w̷Z?Hq:qduYv}r}.8u6s[ 2}.ԟ'j>Ҙ2?RFTjoǦ _zq7e\+l#tnt~3<{Y.7r#c68[#NEۇRN3I.^gX}(eIf7 s-R+YD3}.:Xx R5G4x{SڏIA\Q:=s %VRapՇxq{]u`۟-;k`{\^RsVYB"aYb' ֛|u=R-/aawo_wߨ? W.dIksCܝ+|^\o~ꂞ^܆'1 :c1\7+8RɮThs@_ x6CbzY?0\C_˧hCԨ e(Vr|i63Ixs 3 3)ERG-ܞoW凝Djd%Xt `3¾#vOT3˼ ҝ#HH(BR:*Ob#r-ӕM1KFΔU=qr)n˅YTSd^ڃ>:}>5gRcʣ c-x*h>Jҽ*zʁU=rOD_>MgI ER }ݔ̒) RDfr?uʰTS?E8eTDe++);- +(薀/f; n>BvXLpT/U R+H(? PKrƏfAH#zb!gYS5U6`ri +,㉯Xo'7<0  1p'XaKġ^Ӗ12J92⼠ +\}pxu$2E^!XleZSm8yt9>e5c…6Lb%1cBo$(DQ}CĂ|zu?ep<ՐVGͳƔQ%P)3|XH2H.j +M,syX'Sʱ$G0b#rͅBtnK9EX=cIݾDqo W,ʼ4hvBO{>elȦKs0Gs叟מ'O5<8BH(eMFwRa>5?nğY8avuV\䐚dCRT35ṁ1685'o1Ow聬;L>Jمe;FϼE +:jNqdCUfJYCNkbNļz -GƙI*} Pˌk*K//T2z`i6F$Ò(jں#fhNB { )U } ";r30CnvѶ`j>]9P[/6G%tSL ++6" ZRz#؄a^*0#nu9*kwTتBH~Bؿh,Ϩ][LfJG@jIV:$F@oKXhO5 'R9N͐;o{jWjv7 υW>wC=~u>Y.巐MBnߏ`N۞-zF˅;$Idr+nuE&2p-2|y3nr)CL;aݡBzpR:vzh "PÀD"QﺃL}SJ5vk*r4DŽ[27H3A;tq:x{+]1)Mf}1xAQa`ySFtbiQ<ҎKtVț>R][(XTa͵_]: ڲ]96CB{*/aM-gJu+vlAڏnTq`Sa)Zrdx+-՝xDnVt0fXKH<%Fo&K;/tOu]_,&A*!8zPHs&[n̗۾Z)wuStQiv?隒a+֛6]hNFrbh&Q^B-41K7~R[`քjڐq \t%~uptRxj +^jZj c cA*3 8cBbN06*{$fMz!!'~rnpʮz5/4.FʻGuBW+} טacI,㶛2i|Ri`IeU4]=_):^.*Ǖ=ΔoBHOMW)*kԺABZe^&O9Ќ!vՔw m u'gjh5[/׶>4_^gY6yԞ~Ajkw9<׮!0DJSe0WW6R0 T}6G`kS-r.ڝ=w4tZ-tONWp*462-6^^gtRsvD}|@yS ͞\ǵŔōrRCsvM-Fr+RERg$ހM+X^x>~:< uK4%Gk& WO5mc;y[hOMEJFA|+h5,4uKr͡km%k?m'f~<]}ہ` #-7R]`/ *N6\$5ձ㓸=]ugoF?;ws;wtabN+М}:qm#;+{xyHbޜ.VJ4C\YɵwagyM-'ב8*T;^*0|v@;kU:<ڲgŠqlu1V8Lٰ s2m)Sy]X|nh@dT7tf@cj'URҽck$BSEs,nM\ /!7.H'^ߕJWiQ6g^'=RW"T;l3< Y.jgiM;;C +hԫUNMj )6X-FQhWC9uHMjz+uQh}<ʝq绾ԝ|~bvCXwx]7CQ|z]W;9UziUi`$/G\u>T`̱ +9'+.4Qjm({U9t^ #R5n278},jgkvV H~Tl]m\~ʭT$X2a,gHf`-zbavT1&ZяYm +}&0)zy -Nau=+ $Lv=rdHΔPf%PE3 gp7f-Qul-v61ϪW;QRR=>}7!i3-,+C;+2>HM$Q굖T+eP]K]fGuyqĔZQ0'_{_f5[L$Y9@k|pMНwiy_y;h3{B MmQlt9$9} v +Œ| rísa#rBJaR5e{FmvG]F}^㓅'+KE5{-s{xS,5bigb"PzH|2F|EfEZb,4i}ԅMô?l {wA 4~(>mV-|E4MTe'`,n)}@fR]7XYj +ojcuz -tM4F +7RBդm=˹+vQvVIv!q/ ts]0kJzf97 %>pb݇jogl׃G-5mه\c兺&k g[ud{O;8Ў6}=X?Yg|z)?@ +dF!G5R2B@&D|XerI9&H &ܚAj"T[yhS;xq桝R1XAbhgY>ﺴ{mzI,Rh4IbD&Ohw,Ww"49tv^&̦A'hT<>r*>1Bm7PI#Lr[7W 6Yd5 #u/XJ;.T;ϵ|BQfhga.j=`uSmuv*vVY}N$y_|oo '.ϦV'uM^ڄ#K'45H^9;VK&ȊŤ&oP~'s]OC 6r/naT<#9JQÌ:#"~b \ > +hsy c2?n]o"|i^I RE|.ezVngT; , 2JSC5jS+P#|wm^.qvÁecSK5s "=p-z{7Ѧ;P 縵T^Ip ˑGX$ZHc68`g9yL*H 1Wڢndi){K).D3Rb=ȥt#i$qb͓m؟^nga]Ps MgfB@e+lqD hA[{bԪfp]S΅ K? ľhþc`\oh!7)o"@;(NϠ m<;n>W޸_}G."QTl(yMe?ǘ/%4~<~c>t 7|cX]s>?jgA+Y5>+;9vVivybt|]a#5߇f aa۹r=9ryh5_=Ntvk{.>_uD~ǃoIk)гOOeo*DśM=y]zd>w"55֟*\_&oyBtS)4k>䵶AfY2;H>wBIdr!I=$:Kl[10º1hAs0sg+h.|rQ#47ccBיJzE+/ ,"kaTؒϠ kmĈL#T nk"1F+QKf5si:eR T]V@Ly@6ѐSEN"6n69ObkHOŚ#mqg`ʪdFMQ07at=ߴĦ shݶy\zqBlT9Kr|1e4kqQYemm$aNm?O5ֵ{{߷c$ւС7A?>MlBllt,tͪgރjU'\6N9*֑Zr<+?"=wmtdVQ?=ukNM +?i~ rw/:$@}U8u j*5sEAjjcTzmtDb?qV1f`JQ}㼄mu ROQs:#I>KS }+_Dg[?h>Rb-J3fÇ3ĺ`-1Z)tɦQ=tMő T&ՎQY6z sqϊjb vQyz8Pw9abonIQx]`t=X;=]J)cr-İ3MF@ yyo/=XC'g-v|L[o4-hZ{dh ~Swyʹ1̊ƤCKi<%0]i'D;|q \謣Wk⍡_A5UH\>{X&P 7i ^;4Q$9[ PI?ޛ4A݋"Ͱ'k)C֘U[@S{cBj_jy ch߫gtMIXC=H䌚[Eb4r$|7]EMXT#O[y|8{"KMt,8}b/ƏAAk pۆΦ B zyG!l/Ljρ{T"h5CJ94 wijH.]%ڍǦOܴ{T+ڎ=Z#U(U;t;.e[?[o8$CXqpz;eho2Oi$Wv³XЭBM81w3$ߪz8齲ͧfm7I/>oVqH,+ĵ|k=ʻM&rmqWsۮE/g}L1>BS{ՇȫI _k:Zhi|TM|)IRsY 4IVJ[MF\I|TGj&ZoA_Zb< ]\wI*-mCc\3MIH,Mg!_AҖw9ck2 B <ꦧ{с1J|4TO ZftnFSmOpyŚ C1ǥM{O:WЊ:;c rJyl@sga +-ϗ7 IĠ +a`>L:H)D +PpExT1~FŮ2RGÑ7gUfJmYě@>(Pl{J Sɀ~ԭ2VE1 +M2Z-f~`&@ƀO5e#KB2Mg{>䧊 !9ARe.v hEG+%[ۙvRtc1:1uͣeNH>,ThNr-AݕDG&|KJ ?5-4I4 IRI|t+G1'R秭DHʷTls5y 7T!" ݄"SAVqÅƙH)I3S(=-)6#f$?b6o`mIQB if*s;NU}뙲n:jJ +Z ibz{)A.K0UJ*mCpJ)@  Cvӝ4cMx)dD.mAQFJURˀFWGI&J,Q&ބ%ÇkJ +J +1\L%ijRE(Wzf9-0 (<7@fVx)tf uԍ2kVL4:C>ć<T#P=@#R +$S!*\J_hI\Pɭ,9_5;۝@1e:HIVY).Â0 #wDm#/.ԟ+HvL tP*II+g7 'R2t@+45kmABט< c"'Q"dlR`NJ}SKl5QTe8ur\j9\ >`*F&$^1CS4uǧ2 |K9:@"BjD;JaڢQxr%` +z)BrZGƂ:N%1(P%b"3Ȝ7RrzU|?Zň>+A( !ڈ9[YJoZu)& )}-jtvU4 #16fuM2Qk N4լ^k4PRcϳfY U]7H +GC9:\K tɓ񱤪d('AZmCJKoH)o t9 ],r]A "uO֭;0IK) _dM} '.H%c%fE9lFQ:]]%%ǠvU F.^Z9@Rd?D,ynӕ\Ӗ Uog_3 +-1ڽ@4H.ZFˌv:WtѠ!MC rw\%URk~/|W^ON3` Sfrv`|U MHlћg +ć(cJofCWzSLa,D 1 A!fBwhJ,!߹K,֤ڃ4h:;|Vz16XbK.$dJ@% /f[I)ʨ:݈]Xmɱ>xҎAA'ۗ26>}K6w޼mk,AVu +ߤ:8HQe +dF;<@n!Ǭ郮Tm5YA2P 6l<u%ĖB2(w=d7 焹TM۶tbs Ng(%p#pt+CljXPuiO>k0r[i;kmiL<sEH >1]zԧ_ bDo% A8jQou1ą +RX9J/rc/Z&fA>:zbI֔yQ=]L3!)iݱ )-,<\*_+*Tӱ&A Ǧ'g+^ݣyBy2id\H"QmdX*1d G4_ qM-A<]dS2ް%h'5:fqM EV<(WJu\K |%WbIX ̀?:]h2!%2^4#gVۡ#7 +"6V%6D}%}dI5PRqmJH)\я粞1 .f.*XQ҆SSy,.1]PT[YJOA͋pmK݂-Y*a_X!O9H2RXВVxcXm!сZuj2D(G3H~L^<8Np +hb!P 6*H CU@M0(.&W@CO4FNJ<GAʎ&u=+ޠB+9g8=swLd|o:;w'eN!ȫAyCnEj5$n}"O% +#oEK8gI|I|9eN0vq!CP +fbs,i.Bb)Q$2aC[``N?)n@Dso09;#[q433JQ "?Aj8Ԍ"w<UUO}hPԲ\p2h9~*;P@bCjX2"yj3֕,U#%!/wQhR6 +?tƙ,d [hOBlUJYߏIG~(ƚrQIlD)kq1Y݂`"uy//kBBfDI0QƨPOằI&7RZ,ӥQ5 `I[JyZqPCZ/ ~`n%bz[\ +&%)AmsMWfKiuv\Dp@ 7i=\Ѐ5RKo>IyLKڜ*{3PKs +&99H N2Hn +P֦A HA*3R_KbIhn'>=VtjL)e(\q7AJ.I_S3kOlv -8|J %Wr<9AZh^H)$%hq\sP#QiRL@6P$B*l"2W>qa '(MZma֛ ]/@*R2u)V.'f)҆s- 2`~loN +s*pWgEAI'P$vu'HIU2[@$Ǻ^.st9>$5ZN|k &ApC\-K1rʺM֔ӵ:PK;hYj{"9aO0k*tH)yEul:F"^Eeq.a㚨@YJE!ck2۹N+a}N?XJQ]۠>p8y CK +vsN؎|~&ٞR3}sVC|d.ƈm. "-`r=kJL(xS&ꞋrLb+<43[ 1">b5rBIk ^ +-cҖp1BnG..ܰ6ES ~Ӯ'~ #z4_jhc ÁӉ.N%iCnJ!׽ +:*t_W.+uD%u:X ޸E7җaͶxOMb x] ^䕵l"Q{ky2}rױ%qQNɰ%PzOki̽33Os\t`Jg/gC4'g +|S8)\MloEO6c%q 1^]B'v.^DAoւ""(:s s%R*@TL>׷1g|'q}uzP7tث:qЙ˯yub쐴Xb6릘"[.얶E"[+Fg җ+鵆Mک-yS8!1'%出bmM|0G\w$T ' ~Nqg1t>_np_" y`CD*VP.:)9q)ա#Ѡvm!S TȸfeI 0&}lOڏ#d95A:c\G ܟjnėS5Yqw8IkCjUQls*tW`WAY1sXNT!B/(BK3s\(=<&`;atl2a7ׁ ,na8%XEg\IZ<*Vn}]9\5tEx#ȏJa'A\:~m4t%L-G@naH&~7?\8. `kxqj7NwxMt n*S  :b?P`0lnd 0؏h=3*5N^CǸYx>^=d]3Z{τf?84F \5g9[ +?`ep]{ϹrQ[*z8e7^!Eĭ)眀cҟjA &K 衎J]cXBs"y:-X2V +]j%xQCcC1xrf`xc Y ( Zp97P%7h UimαAN)'O9? _Q )j1Quw)AIP8 +A8#/p .KȊ=b9̨Dr*USشp. 16 A(mܕOSue.6sXNG/=7G.yCf +O źדs0|y4u ץD.~V0`@z;sWN-AW)p ܚ8 s W5!585ndM>?/8-)}w]ʭ3J*ߥBwRo7qKnȔOK W١@NVPT@ +:*\sf +\<*3!=Cy09> ܏<9"(jiR.]T +WLP셸>ⅠXǩo@,x9(voN\-j{}xOm5lPiC'pap (">ͩAPHODke5#Hq(N5jpjCjU8ĥ1yR|\û~(̈́d0bwV8U +:ҭC& B\Zt{&z.֡Jk煮> _Jy\]e ?;A Mb~u̍IVO,KoclSAwdX|19MuRUDښF;je4 !% AyHO< 5_FF2K%t`6 m\{:Z{ؚHUeڵ95fAXqqSK.ޘ5O$Ԟ`) +Z(GX"+~3.PsᒼlWAӰ2xEOj[bf, 4gk#K|Q\&4G l^ݗ!vՃ@'SUC/5S'J~M"Qr5UdKOz_-4@RCA-;P Cj.R#@Hs6+%178\r$RTA iąCɠNZͩAXzOxWJyIrj.CjЧJu_z xENy T0~Tej9~ߤ +9PE;2POENu1SC]ù:bkG5)M`p9!PՁ\*pt?I|4}i!~F*7g=m]k_'s>f>tQZ``yeͩ;Gc@ 󻿎 +{ |5}`uO]NG+Kb*5ı*Q)e4WE:UP:LnAE3UPwCB%P#ʁ̵`n{\/ p3:Y񼽂SotIM @- e2Cpș/%Nja'BtDaqjρC<9aM^UbdPEC5ScB-W:P yWF@ +{*HrPncugu(FC5\r!Ᲊ o:ϗx^ 47fTʧveFx1.U b&}a]|T+0y^EI,vJc":z"jUywe2j"ϜRSVN5_st >㑹 M@=͉G&=%p\MԁC"ID}"+P\v#} @6 +~QSS.Eυ'#V߇9N^ն̓-p"Τ]@]8Cȷh+M<7q'9vzC$>ٛĞY`n!g zN5☐x!B9u1)\.bXa\>fX~O6rJO#1cXHP!~>ퟻ ++{0` js99ȗ] NPlz!r 5H^/SA5ضº:Qc%/ofP< e)aI<1AJff]\50]p]*\\{\W2(( QA7s9x^I˸ 1c~/GθM3}nxT95|%N/(k#e2iax3 ;8L +`S;ɍE?6嗿 USb@vk1 {uޔȘg)<*[!-v5L \ o7廨9U?=wޒعLVJs5t-Րu,*m8Iѹx#9O/pJQ< }y,wVb]B!T@jdar#9(2w^YPfI\ +B΢3[۟}ԅY? ȷߍO~YH|LPgw $/H֝kLmWB6#(:[RzU`+vgbZD$O&6RM ^K$O^Ԟ2~Xm&KKԥuZt|l{vü~/ұ*f#:Rۦ!|Sbl nSS!w)5'?wy~#&aZDuGD9m$6A&w0w6sH< 軟#&v -bf4INJ:]C_HRŗ +9FXƨN QrkE6 djH +\A&4cmRQH/<@Ӧv{x~ہn|Iʼ9*<(ǘFe''-a'b̂Y _(&aMDKk&o?\6y4RFj֧zޘܭ 8I*2  o0mj. IȅX^?6e$VRz%6Ӻ nPbn>\A)q +o}_MԮ#NM%t ҿ +wT6,` ~{BUI&Q ՂL}wy|ndGSQkY|-'ZZW銟z(J8E*{Pcb]v\ ӧE$eDWuaL.N,(s #wBbƢl e)BVˀoR MA _d"Ω=.i8%]xUH藉 +Ήr/{e>F݌k;N~>LKŽg_&}7*"?e]gm7ʲkTfJ&ɟ~uP̓v$ɔy魺Dj('{ZqַE уeD=h$ME/LɻtO̽6jOH2OF~;|>˔u\/ҕ:D> +}Bѣfto$lr3/ 6ٳ֜lrﰢ&3>kS؇Z^9MΖc\ +UuWeuHW̟\FjоO +$B(A^%A]AmYZ a긬Ҹ`qInuI&8݈*)(瘤~m $R #k 1$Q_%%%ޢ=_E@3͉nޑeÏv %~s58¤8X-moj;y~7hμ<,LHP45/=k9.zsz/\RQqM\[ kiUtcf̩1G;G{.vTKk,}&Lq9}Сޜm6'F^\z1.Dkz@="$\&O]HTn 0):`w ^-4D5ig֖lZyeءa&kaSǬb!:ƈvwI:ކj{1)X˓"wkfR|Hӻ&uM-b3L{ɶp£]C=J<` ~b< \g$Z]0&KB؇$;mu{++X۽piPPa?41]i˩Z&/j.Jw#R8@UNZ<;^Eme[(jiptW^3U\0m`.ZR#ʝ£+#jnF;\l1z.Z #%uIȅ}?>]'j~~@Sd W+ޭG-RnƩuBi\] D)yzʸIZZa'zc*Lu0h[\x1HHkK~|}U[x4rcLkwKwL\c[wUvѴCca NaU5w+xCn{z{xU ZvIB_ J_6i8+-"ypyL1wğ=%Ʃ挨)qgoŞj'M*yq{P?%vm3LKC9tK54]~c&C:㣞qLI;cm"?98RSbucp[gMoO[PjCZZ +UV%5~~Jˀk٥A!>gÍj<ͺuW3iMWg}upika(q7ALv᭯^Rc\{&憙I +j +uu9ے'/c:udF97yG{FD:߭ +&7eׂs#^مfGoj7ɪNIJj- k7uQ\P[UCu8cFQl|ܣ" +’ +]BmB{90hc?> ;û'ldά0JT^vѹ? 7Awm\ *lHh ;ҝNh3) +㳽Is_۪ʛQ%!.!*CDž;ޜ,)5~,i~l6zrw]ѫ_5oJK8Ӝ}cf!z^>$z~{߫|t5{lΞ0j(±>q]u[V 6 ,clc5m2*]LvڞYju/W~'kJtYn+giA{'{^r%~oa%z!M+ $EV&U[Vć߈I-sjHvWzvkq]|Cr}UPUeD|Ч,#~!/43 +YPs--:a+nĶ<м;;T[z戈z:hf5553(d t 󏘥1OUw8-FgxbS0{w JN5%w \+؏a;쎵gFT<,p~SlU#_Nvؾ@/>cURi7t +s ^`/`^tyupVuo[GGC`Au_*64?`rQn@vA[wCJ;Jhֽh +ڨCʄ0kϧmFA~m+ Jzs#;|Ј\|`<;iLwUmˌ(ʿ=:[DRSh a?a)7 ! o/-Z?hd~6gyƫF hb5 Ľ]AgqS{׫#޻$.pv1$55Y]b"l_˷/ L(s + plnvfK'\M+iZ\]v5S9u1+e d4F4%?!?_G=H}^Q̷wїzwώWZ6cz?>L5k|éFỒFs3_p|C &< h԰)D4Rn"i5e-Z:V5? kmaI_׉.!yC?8`ShRaߵ7E!'BDx15z5FV}l=u ݼ-{x 4;~ƍ_= ܍oދkD*3ﲫ أLGǬUбЫ5ob,$aDPǬ.oy[,!.&H=s1cO +~Ŭ.s4ܟO;g6s2xZqsjˬ/F}%EC\?؇9q +{=ر?ܷ=̧Fhj]wKbK]BKoY%uUͭ6WB&qkp w皓㞿`Lcӑs47Iĩ[ѢBJ +"75?pFk9a9"9F9ŗǾwww - +˩'JC]tJY5+61d {9{ca hҰxa4hڈehh4eZ4kZv}7B5ar0ɧR/MƄ25Sm/ nntsNPaďwH,AV اU1)^fM܂L߅fOہflG3nC'lDGm@SǭGSf2ؕy}SU)v ƾ995cB2JJR]YIo_v8Ka"2\4 "x~?b[MMM͚w-Z= &J=E+k&~g#r#" K">G8D<vzhkZzz,Mc9>Gsvd̟O0b1ih̭h}h2u4!Df/5D +sьEh +Gm[&g7H> |ᖂ!16 /r 83 ǃ<_0+. -)( c yWnɖ]طNvr4gs=8C# Yhؕh h}h:)Z4Z_'b4w1f-'Ь<4CA͙ŽNPj^?[3Kd;p1l9@K525PWB ԭJ~h,ӽusv=**P͘Wqu\rsB3G\j<zs]l /a-{ Ǿl"K/+r6r3Y㖠iaۈɫ/ALzshIt=Zjxu嶻Վw]`|JLu[]+:㱕( Xe::&&9gub a/[2t)ͯa®[l +vj'ot/ ʻmg[ kRw->bI-,ok>ُx,}_Ex*hB5l+Y~ڎm&gx͛͝WPAZZ цrFoo`O9͚],Oڸ퉛@\פ|B?^:F1qiou2`OiTnNSאoáCc9zi椵h.6hv3l-^ru͛cJZB6rh7ZOEG_o);GUV7dy HSuia:jLHx{#"͈MM{Bjʬ*,\BXr޹ql#L|dُq} rQM">qH-Q{f.T~ɮ<]'owN5eCWQ>E5]uU5̞7̞}-t3{{1*prπ;`TZr-&d>.df_< lgmӗd0j.7e=ZF32n=+kczMH0^Rƕ}e@82DӐiY_PT}QQ¤20?aʼb*ʞU䵜z'BHE%?]{6u"7|h Z$Za]ZKhchVXV@kDHQ; +Ob*VM5eM?|.B姵n hV'kv~)k+a)~k*l840 3z*EXYqŹ/ϥ'L-vpbEc]k3A$ɨ'4.Ō[j7x(lG 0νz;bG]^{;ޯ!adKݢͪ +(p +v q^{oOحZe5w\|a~U10>!ePGpF*&u<)"%Tﺢc2&|o:MA{͆h%kS,&DKVX=>m헃?Sg >u-e 2+f Y3kmɞ䕱kV0mK|^BVA'ւƞC=K]Ez:K619J#qi}y);xN{lhӦ7^2o^)KoM$yhhEGoCV h{÷(U~iajV:0V᱂[Vn*>Nl0ϗhtZ謇mխ);T4MF{čϵ%X4E%? 8*XN?eUxoY͆/>ElG}FiW§  !;)I󩨆wWd5W񃻅gn3w>dh쭜\#dyfmA+ 09ٵj>_Ykmo9Ac[\ھ+IӒFgii== !bg"];-ԿJ>aԇ 0!Ze/cvZ%W3&"MaQ kn+QYwFx1lemd7E + +uRcod_H]j~nse>؂P+zVoBd/} ό%Խ +|mF~N?bi@6!HhM#24V Y Ç;]I6U#ݥJ4Y}zVOk5*b^BQHFhk۷#"]I=4AGE/{A$%%ݓq@Km=3NiD\^-EM9b[()?yS"`o*xy!ieA>| ;);KS^V|b-" SϦռ5Ibx6'*+Y3ZH]EITFwF³cmC2IEx~@L:! pN6[$:'(B ar292͉T'k5?&4&'}YvD(fdRu=t:|?^Mض{Zt 뻞Q~%TAϛ}voR=3ZUDʀ*C$Hh#E'3W6 Y|>YNӖ] NӕXrz /N_🨪lf`޴aR۵><0BzB9wc$+NM[ElÙa&ZO]a&y"#ޭZ$oVת8$EJ|VHn瓖~Kw ߈Q7u?e|'𼿘rwZ q0/?f(Fp6{rDXۃpTpj.a:<)S]tT +͆~F\?&Rx_vQQFU"Y ΋ئP~ȫ>SHT;nodԫ.)ׄm?Bd j/;'NgL[dm鋺eťTN0RMVa)Z3a!:iшjH#sÉWG +dWGܧc#.zNڏ㛚ˁ2VrTN3pѩ+cWVA4""SIu.MkH]"SԤ?pa|n "+ +2h3zHAJ^Q{L2z"n7[NσԍEDX6^UsK0ZϺ(w'rP!?0<7I}HsQ< SZX@9'o=[n +vc.)`<: >YkزT|~N.}#LVm2u 0i0:~F +. 5ԫ~ yp/?:~p$1´U"ep?$,'-Oex燲JTMSeFnb}{ftgha߆t (CZ:쌼"p*g"I39mqXӏ {$4 Ug7qa噾d W!K-a#@O,ѝZ8N*jPzxD'u"& ##w39&=S?l^MfлtaBv]; ٌ0fxpDk#wnڎ6,Xvoۏ4 ЈWJc?h~| (aΆE䑼Αb? Vc cvwuOuU/O_ʝɳᛠM\_AϬUDd["RAJ>"ǀ6$7.~|yyuTob98>tD>u=&#$:mY+Z%X_yI9)kw$ro0a'w:a\N8[4(A*˩8#zWw1o>]gmU¨Sʌ `Cd;!Nl,kc[vDdr aJ 3 -Б򵥗2{{?[kQ9-#uk{~O/_վU{>vvӺC߷ߋc5ud&F}m[O1?6@1:'cTKެ +Yp#럾4{SC <;3}/]>11F`ŎO~dhRL{\_ZKro+N ?ld^9'cy1Foъ4 oΔ{qm|_Kҳk{/{?k}}M)`lwS<7 ` +WZgqs}\8svf·KM_`|15m~%ORm(n|{OܽlpcLy̫P-/:"}ø0Plxo^k56?[ca΂` +ʻ7\:`_WW>~~x#+8߿%\D֝{Ced0ż!45>Էc"o{Пn8u.\E2xs3aВga TyX5_܇6ƌƵ!+Cy0S9=A`'^9cfa?YsFx3_g6vݽl0Ph W"b תS76#O1ߛZzRէ{2۷x 3o]QwGߺdBg/8(صt́ ݛ*}K&̞J\\0k 9cɄ(~ WQ,~5͇&Eq=JƵ'~RNyvd;?e"|s(u>]w~a럆\>chz&A;o75mwm8땊9``L'w?77,̞8fkE$=ն' 1V-w-9v~`8]aL%|ӂ޼ +cNВKC]/իP΢][u"siO|0?5xgx]'>q%̶p*FkjwuJ[U4-k>aخ5. :d4I0&7Ɵ?К t,{xb׮EqO|(6y/mߺb<7W-?;Y='[섺 +;1\cNJfi@Hy@2}i3Hq1)_%ƄE* -Yv(si1.>fe:{ūzmWa\.YJO8u]?S#^j Wz{e9?UB~qK݀&bN=W/,9x\}3çPEpw=hx{Ib9ayj+k +JYq9kN,qnW.vƉXGxscn}`> +D0>WGA?Xě2ѴW(_Q39ǂ sc\@ cm{OΞTqm`1qœ 1X/p<gN|pck"~w*u=;ヅ-+Iz%7b;.wh~0a`jO2;س̦)g>rz;:ۃG:d?TS,/_Jn<-xi~0W:31#ca53\KDyn:$3xyWtYSbQ_A oy_ ?v^ir Evӂ~;# Gs}`?LuߡQ7ǵy033\{^~Icd/pߪCO~ y{1Ů;ڦ}6/u1Zp +=Xo_ք͘ h)sꖦC߄qBqM/yW|ys  _qܳ֞ 8q)lձß44ݿT1gkx[U.(զoMȑ?79I~UD[_12w?pںw yËapE}#9cCnQc̭ ,5އΉvo9;rׅ=m?b+&BF{;sY@/{O w~F1w; @a n)o󪽗5/M`Sboqr>Lc,9շW̯ h~4_}y?NѦ[0 #gn/^;#c7?x5z|k[.v/{ڗ^uYDz#o]8Dc^>س\9߹ߦpb y@.wMvO$ȹ}5|=GP#bϢO~Olٜǘ?{C"ܻbM?c}MMЖ}.iG_z|05tⱘsB0?ƿ_'sf^1{&0w35w;3؞rfݽ̕ Twڳ"@bUMdvg/tϷ7=sg-4_1lS8uBShxݜ^fsrb.\zRbڮ=b*?xK7y1̂}+۸{㙔nYwv>sD "Qݖ=) t<—(w;!̝]}O]1cWsgRNo=xތ@m|ղpkZys)?1Zn<˟Dτ1)?)79Zқ|u-+_{Ο*aŽȵ*§#^Vp%L]O$Xܔh(,|8ߨ˜F{;9U[^N9>,^s掊WzЋᥘ;kAEC=3Yz2}7r(ֹ4=w;+OYpˢ(,X51gN]+v_D9Wly,>~)o^ 5t?>ókcV#}@6kZ~t{Ot3|; /x}/L{$MN599(1o|q;5a_*W +깑/Bm 91Ztr"aYb_ؚ/m^]׆s b%E=[myc㚂f+pebg6|i96'N&zO/?y4ԫw^[?C姢|S?1ŧr.1\{=9Uч^rm}yOf b, B,jIq 0\sZ,tX^-wKoMH@f4rg&rp-ȝ6yHϑ['b2̝6rgrg-{ԉ(_,y%'m{p^<'S-߲>[G;>aߕsrO?muѕǸϘr>56+r1,xTd'w}_>5Z̉+z yG*#|ъp8q={/V93Bʢ.Io!^1.XQ7"`W`t))ʝMMƵI} +fos|;k>J[c`"Ƒ?Q9>ߛ{:/d-L_9#m'] ?1wCWcD̡Fk왏o?M5l `_D=9Pܔ=W\r$lcAf/i^;v^ز-'7uӂ?F_cCc'L(w +i;k.̝u\/Xݔ)wV3OYYYi#w֒-!-c΋<{)`.楛`~s+P};"PλNa^*(sj^9~2ڹtO=s~GW>}aC/ܦ}_L;;N@C[SD+`'=-X8>r϶7l00﴿ {0[a +=wVS9MoK0ɘ˗J'[&ҷr?TGrgaTߩ>3w2=wV (w֫ 즳}Mqw̷{+ 7uKv&{|Pu=WEmG68Joji_|ĹBw4.jMg}ۼ 0 #o\;<{=y~8L dR(ǚWd$5ʳk`jK_|]/.y?q[R;-wm(ت7P E=u{~C=r`%?~'  X``7C=$LTq_sc^TM-d5g~u+g܆u͍M$ )}Gz6{8&T?0wVK6=խ;+ȫSGxËWWcYiS(w +>7^̝u;+wЮ((#hd~] |s>|{Bd;i \O|O ?Bymq%>~L:73?),c>;b[6/`{ï^kW> ^Dkp(Xdkl ݿ9POoW,91_vL̃[wZ-(=G]  `7m+0c>\ )_oPfC#;@n>Ah~OpO]p9+Ïui]͏&ubSc(G͚._ Ϡ[dݷwXǛ|Ծ&CvҢ\`<v{/M9+ڧ;?;u/||GЯk>#/s)%$u w>%kfi叝[p ԔC̻Ao +%75n5./?c+q]ɓ}q}U +('')b)GŵPGjB|Fжo]k(CU>(ztR~ŜT\ypmϒEH=+ykH޹.Iy>߄[<:|MCߪB&ǵnev9Hrũ ѥ;~=W4E>锳(Lh/o +?˛cx-4ǜκ)_< 1VP3wq:֟N2WC>To9EО'ޝ\C=HugRN,Ѩ#aߚ76D7Abޚ{\uZXBȿ}"Qet\<sQ ̵VBy1gs9rųi됽*-@"7d:CK`^%Y8EuO|')ג 5W'7^]>MM{~1G{:@v リq=}W>q# {~FSd}{N@[V΁9B+97#Fjb=~1=6ÛÏ/>}ޓw/Y9dlkzXbc [ B W/.{|Iy{K>G ~#AM$9^<s:S>aW\rvP݊-Nu8 啫&bBE:U=\ft Wyw휈~/r'ʱ=7#>ǹ_6ر$<$r` +G=t&wq?~܏q?~܏q?~܏q?~܏q?~qL4mF< V9zl"S9rRLvF5Lw3}iXW333.ޗȴ0-bt9,)Q x3Yk?{3ɎdZ㩄tWY%K2eEQȊx9c=X^^D[q +,ЋF(YT쪼RL ++,jg]&Z槻2ɮlJ+I\*w/=+BN5/^ {:S]St+\؛M "a2'Z%SmDyZl_7 da&MLw%[vu>$՞]Hv,x'= }1aZl.r CT=:ս(:+O >3⠤ޕh֤{ڠo5eN!jf{WN9DJ>p&DWk)*agr +O&ӛrG/̶-zd*ᜭq9uvַfK^e¶0ޓI s9ɫ {@6IhrNe0Fx|Lkbv&޽(Xr=0'Rs69 eWhDsyB=%[өtfEkvӗrr?=t'Z{!ck0zz3քtr*Πc`t{SeD+8P dm'VrT\S$-wazERV4[̰ }\Tt+[W̒YL[ӎ QaH@vJm +O[d!L+?P4/uXWY< |t żs@9m-.md; ($:Y.Bǎ.~mh;J9/H &O%*V{Cr:GĎAǣt:UI$;)Y*1%p|bW^g3ds*5y(nPI 2}R.OmTܹB9ZҙET1,e r7IJ6:Vc,t<sΐK9ז˄ =/jcjt62:GcR.\1@="E>%VxvQ+%Rb ++87 +daQG3=ݩxk3ѕ.?oT\RRǤ\,1\9N!+(:\ҙyG)-g]3 cR.L) R*(?d*UWj4 ۶I/hOA!iAf~>!yFaѳ1%[[{;{﵃g2˝y&% CP%%E YtD{&ãpt+w|5jv~Vt7i6rzОLQږ(Y&dg8Q)wLYG·\*u)>VfZnjL 6Svn3cߌSqC||98VGquqgFX3g-Ǚ"RcqugʈǙ"]3 q8;ΔQCy4eOHw07Gā2,H ,)|L%Hnx I_gxoeffU\V-r7\n.wsXnm\6s oНDEL"<N"wND!k)h)z}rRGt\u:[r⃙DgzpnLhŤqHn@7iX4Fň4=)deb0\ɮD{kvغ"s;c<=~͓E)Uja1KL+YˁwclqBtA&GM!H7j ,?0TNamJTAvmࣥ{tr pv@9m-.md; hdEs.JgcH=8~ÿ\\R\gr\w>`ܽ7f9JJyTl9u%8w n83w: QޑI$=';ӗ$өDvz&6=w .ЍtD"+Vb1Lq X|y7;HH;7՟I22Peߙ[k7MOwt<d/mc{m9t:\ VkpGX(^i,.渋9b.渋9b3 ҍКSڶljpWܕcOwij9 +{ 51&/نxrc <[3a9Ra9Ra9qr"t$MH1jHv+BKau#["Eh8-ܨVCa,E-)Ҫ|ؓ{ؿ,L0D!h+9˄rmaw[VҀ8NL'ZCncX(׈+q#INtQ&_ô4V/Cdn2]Ŋ ѹ8c18Wj+史$wdw&2V?.v?JGY-aKeݞfZe14p.ێ?ߧr1Ҿl2:zƧ"cn]JzǚZI$Mt:7jT{B7\pEn"j[3Ñ3Sc5u)vG70őդ)eX[v#p:]==Њl,2ew<}%V|bi9cze*m嵁P\ءV˙[.wmc`Z̬=vS4ma*޺xG+Jw[پiE,:dRG⢆o\n,R=Ov,M⸄&p,2[.Wlgyc0*rhʅ9g_i(8Kq\7[0{qm2ڈӭ7oMZŨ9JHiTl9uiqhnD֒6Jন5[[]Ԍ/Ovj>?j֌$1bSq~cIYBrQ\m ǒ ˺]"Š3}-Z/Xvړ<ʓ<'|T._iD#Mmcs/6ēk)yX5[<_ |$qN[Gxy; +3DN\Zƕ#=duKP瀔uNZc|ݤ_gͨ|bF@Y)?k`ve;ДpߋggC՞ʏF+)t9-Jg98Ơ5!EJ~FT?OVhUu7G)|p@>=tWC`rLrb `0w5pW +'2xT>Bc\k.(n,jm,?2+{׃f6~][(;=2v.JWGܕwdHCxթk#q@ЏPRXM2-3TVX$bItW4A~DGCnjC~u.L*'Wyfŗ3D*O5 -ŋDeU_x%UfUUIaQ0^VPN4?/+1",/sB$3pȩbEE8YUax>stream +V*/ jesk%<|FS8 *ST:"|+,[(ysmYd G *("GxQFP*plT "QQvT/Щd/xhWUzyYe@$)X`8hAUv5QU VGyF ɪ <(ZAH/FE\2IQ=6XC§20ˬv,"^K=`Y4Te +r}LD AUâ({8ŋ HJI0cLA=0^ࠂY00< |Fl a@3#lWjUVcpLyHS,S +#!y6h6ҬkylױD`?RcBW3:?o#cGb[JwHL-3m{,rhr֪_iSiT(IWf0/%ԾI٪hh:zΛF+Px'}`q7p +*[*|R֮?uS4T7j\$&UQg?V^RJȥcWAɲe}ψgTۀ +8NKcAaYQsOPQ%gdQYʉ`C ZVrTBsY+\%i +l|4И,"Q8II#)0u3` 땭[eO<8@# 25@24KU~(_T]`d*N=DOw$T$b.oX?y1gY8F /l6PY$T*^.8X]`wif0'Kk> 9S5g8~Vxձ5j$o|KAGr(è6NQ lvDp`5zt2Dp'uQ1W8c(NG&78M +d+"~grN6{_fxᑜ DG#IKE\͠i 4Ӧ=  A5` Grh@[Ž%Eb(nkj/)mp($,Jݐ/r ӾF_Rϡ ;آ\ʝf0B? +TNhHRA$ KFN9#1GK 1 A` ͪ=V %"' +ʉ~+R5iAu` xUc6E9 /itgEмY:&!v%a\h=:ecу58cTwSgk73vkk߮7q g.eir9s=Hr)Ll<GZQ*E.T9j aP*pyݰ9` @^=2ң:Z[Y Θ"Y Dt0QgAIY\H [Bkre:I$'J᮫j6dzae,Zm[%ՖQfuhEfSTOF£f3pFj>O_ +4:]SS٘Κgt1њδShK+/ 9u6Ԟt(h -s/ۗJX.1Ԇ+'d +%(&h3"(.FBYd#M +Ґk ÅNa&*&=IA a=NCAnը +ӢR);FѨd S>n"h L?]]eU! g^۶p%y'' ZGo 'GGGUPTNy6#asQކӆX5ur2 +p} +j֮Żd~rڂ`|YY,e<6X*b|n]6a"SH|n/Җp0J +|J4ɠLbş>(,@V8œ>IqqrV0uWoXV3ɚ)|1%_/F5A);G]%)<#s:.ʂHF_9Vc)l^ZĠ3%e :W ƚAKSn`MߠyG +"k~ +!YTM~ ؽey[B]NF>t* +dQgVȪN8F_`TL鴃QB`6U0IaQm@ @g  BqW90XYU +d!yeDIbUëEQyVw<܀QJ)JG($'I)S ы> +9^b8zX +{HiERYaM )`2+Q4+p( Ј b`xJ~#dbFYW)xRADgNezGT; + +Ȳ6lXT`GYc\v$dY9_΋,+skFx[Xm* \$7%φn +0i'?=1͸!N r-31I%$)h'4 +& fz@] S-d 9i@ + !B@$9(UWIKaj^խm" "lĂzngcִ+IOg/I Tct!wt!?6RK%2 2lĄ;1j2@162Br6(\( b WlS8Dǟ_Nh5n`ꂅ?Lh" ^e,!@R.E-vL +A~HKtaPކ8+ ` +mV5{fknBC e&F֮^GYve +pN"LJ]&YILr1&:!EU@v:Ƭ"c"lx0L" JYܐe 6ً0D6=Yar0oLF͆m:Ƭ"c"l׀|mZ=PfBaV3۵(+&t+]SAyTt=T" zb)xƽM3lUKWҬv6 LIv,gz-Ⱥbg:ٮU@-POl(3L ^׎l(3t( EˬebfF ef2[Ѱ rPfa2!7ڵ(NfCQdf(;&FdÙ8pfhWf5]2m3J,Y%\F&Ƌm2gCŸ́hV` ,79ʚ}ZE5tdž0CK!Pje6lPfY8i /KaMLvsbZÏ];pƙ 3tCfEL(2+YBUd"^Dp /f—QYVm:bW,\%Pc@mh: uB1%Fei[x2KL4JM^Y82nmuîY82J xkʍ#]PdHFBMEhW!_qS ޤ^P>6 +!PT2 ButlSPd(hz[m3M#fZM^Q>>Zn3ڶS aӌEy}`,Ҟ:=m`}c" U  P?k{G{= ǺT-M7:jPU(Od7&r_Q^e=\;KKW1(x +ڏU +QP_l Ѣ:hɱyEIQU{l=,k9sBy5cTC肥 uxPSoxV3I-GQlrekh&s"6x4걾LBo]ZX5ө^[wt?T%3 OPm)pTl_PB3[t)?qfc,ҥìoi-fHo +%MO[p\Ne=o~ڸ_x o]WQC:ɀ[UqҩhxA~O +:J9<ͪ±b G(@WtݚFx`C"m)!wt .9DpN*ucv/ɛTXd1\qUgvKG1䴡7][iE;*UjSBk=lyx 0:Xđ~Wzئbk+f'C5i:jsn -!; :vёcf ]ʦpEcpxyE1XJ`kHK,`l6֔ m,L/ y%7h5 `4qQUY;t Fn Zti#W 3۠~k\m9vP^R:$)lqBx ac%Dў!: ;tfE_gWsl-vV18mcPe+;pSr8U) iɧi#xFvbSZ)!J/ oasheNtNx;{I,IkCMDzygoj~ PL^@Q`К!U〽tF*mM"85e9 +5F0Kp:H nh[TKl -[hyjr+zK&T"9Xku sԣnHK,z~G"IcXkD +p~0P,F.w P<y*#ʫ@~NdQg\Mx樋z5o~t hVKp :k)aΐgv^BjWRT(H;>8a"dZP9(A6H ߣc^S ,Уj3Jl%#!E,nIA`1i+h[J=O26p׊PcIW)2LplizjfW`]/1V;+tu55v ֻ݄)dJގ=QQxb7&xf ,jZ ‘3^l sȵeEem5/iqjZ2MqѫG,R+zk e"F%#//fN+hF'|AK:RI*8O{/Ƌ&K${KzbAo4=ȘxE5-;zF'),63fat[ƽ%em"ĵhgFeh۸_mT;Xy8PDPd\Adh!XŸ hS|aM0|? \N`[;SU99Fâ +R<C} tQõt<4$Z)qjM{4B<{m\wu&gao*u (ΩS<^ 0@9Q+:pQ ɊK%L橞RyJP uɅ0Zj}Ԃhm!8B 0> Ys|ޛy/s+{q$`jӋTKs`ZHns ʀz X1NAѝ-aĚW #<y + ,IЏ @f$/0l_*S9unWzi݀\鉷ML!4$뒄tg7΂Y]Fhh3UP=In`a luq-{E46Q{LǀΆe5uF3Slkt33!Ym7uQZA`QqmY7HfJ2(t%ʼ%/ d|ħ I\oks "f2«ʋ +Z( 1"xtyQC2ӕӖPpa(I%چ XѳϪ? Sg.Kb[$pw!o59Dv + +sR^o,A:&4TzfRbؓ{=`ٜf${S>6ghu5ti1r3-x+w^UdŵAl"z4!1cQ9-hqE+ZJCϕLd=dW*r6JdzK*5jJeWO9;=5fַ w%Ƣ1pĉe8QD*O ʰ(9*)TMM s'-B=@ 5M~ؗ/}2QDӋ.'9IM7ᙟ(}Qf% adYNP9eeNVyV GHőN\#Y \#%-=v5Iq= RdNŤh<=QV$,N(k+N4a4DثFd>%  J~D` Y \ގ>Wd5d a Ʊ>Y8{[* +Cv?fD}S.,r?1f<0 +G%z#$5}D0<EQ$ # +%ZlQY8E'$*#NJ`1ishVz8RSL 1}(>`COtnTT'0c" +E?]<>EA0i?=f3_/L_e-&7ölD%JVTKm#g-%U]VL0}\faɋ-#Kql+ngnYaF$@uAʙ\JxJT–;C$k"{%Ioכƴ7\? ୿8GX@1Lqj밷p-QQN. :jހmb5vWb+t ς>JxH?7=xݶFk +_+l4ךoA#y/ QYq҇JA+"I"ZpI ɛRհx'9<{L! Ca[_Us?ՇYLJ[٣vrQc2vg*_S}_{'ZfVN wKd~ϛ1zT/[a9Y^0[1~SҞ#ٵ #\˜,\>#!hTʖzߧ}7 =y|3Z It† #~ɳwz!Vl{ +ꦡ ^|6")`{^Dz?gz ࡑ>%!A&02=a:Lb_hco*uO c'|ޮ&վv +'` L LƭXE~/sY0=~|S#$%j<(J2W`|&tT @ ~#4DW5=VK EpO\%Q%3* +pR(я^FJNQZA&S ) +臄y(a8 7ңA7 +? EҨ +(ˀʡyĀRpQ \AAC>| C"`UfZ!R<L( $?lBXԠ0Gl"*( DOmOtOO܋H>,@B-M2Y'^X1caq$v^</!&Jt,o"QPAx"*#!*w3r?Ƿ8 +kz7Ir`^/Y0XK݇c|~>?te ؒ3<);6 [..e$;E/zڋ@.""z:EB.ovuAs  Dxf;`l0v߁ |AXya\;@q +)L`B%ickM@ i +@y)!f@y,+N<#phbv((_v h(DdZ+1x@v:>B'^ E9G sCS?<`A`@zQI@gT$%U< 0*(mWj=SDiG?I޲ ' rN|K8 Q5_ZQ{}/1~^+#"c vf^=ZŅr9]4Lm9Za|=TU6 +p$0|kr~؂KW +p;Z1ma1ǧϞml1v0 =t̴EdڡL;(vVHb|4ԂcK;l5$o}%&HELh B73:l_IR,ɡI_G]=XL+9.ݍ?x7` e1E{\dq,7鈽Lu-^qL{)׃OhIc6WɨNmΎ IN &Բ<X+Zfv;ɀE!D_-?5 {VN<qڴ2?GX06և`D A=hq9ÐuPh!'^cxk&cx%َ۬Gnf.Q%,"D6qدo~53hW4=HzRL۹! +9Ivרg=B~X|xh _Ta߉mUP'۔ۗj:4qt}h Xe3z8R[N2 VSDꈎːZoط(#;fѰ]gQipI 1-'UĨ8ӳq =JH:K|ɦuj3}Aܸ#$\şWmk6'jp46} + +Q|'M^7}`zՑd~9B8]p$^]IibSt3pI sm@=Fe{;Gdo5Ƭx q]ke4W6+ӪT,7)oyfiGgerv5<0G}KF߀EN] F:mL`%i1A& +JȯR.9s?ܟXZX G&7an1ѯiUUZXHC~v$ߺ_OL~;[avBI~W]9) JHn͆m'L,np !#б(w^c۟{̠#n I zlm4zK^l]K΅ Ft)+jGI]-Zal8~_,6Y0ԉK6iV;d.RmwbTb V;%"6{PxNm:-zu<ƾ, +Ք.j;jJ9#O =4 *(%PSH"f=c&xl˻BJ ({۝:f2hhMI-oe[/{N8 ahhW{p,6xRwLGjv0Qk\E?޹VIt2(h qʶfׂ`q%jHKh cީ_JsxhR[mJqKv.xnt(\D4@ +=!p(H` @{tudH3NAJCO*vݩ'(Pӆ5 Twz1"dR3#Kje١ +?vR.cw˛-O)Zh /Lѳ5X9G(z?m["QB%Gm[9t~؍vs20oO'WPѥiI1Q쑭yҤ h+5DͶlw#4:m} rx<)z޿l_3B} IO |V͗A}௉g,zw$}56o9+6H_x@ogR]ӍҮs$~M|ƾ-C}Ijx.A[gS_ fMB |o$Z3f3Igw؜7KO #scȷ' ).x*T5D|_6w8MgP3.cz_h/̏w[@Al?si.uVBS'i~L-}"sK=QޛcqMtl͘϶\LCCG3KHk ˛4N,דC6-Ti4hf|Ȟoϔ0/XcЪJ4Uj6o[̕q6=|ݥ_OT…]C1a%Ig5]7"$>cwƞvP ;bc ׉A7'38 N{=vyJ%&^Rf-4`%:x:0ӥ^mJ/8ZYmz[g mB c-!kYsaﬓzD3H?({_g뚢Uо9DtūΚiuRإ?:G92_:Wiչ'Xu?y ;D|HQG; ]GzГ BbŪ+ҮKli]˘wl;7oBucЕ3~V]DtL(T'I:|ukGF'x}6}]Uoϛ;x+^77y2֭{T^+z&Yћ2}~S޹3~J/Q +E1s/o;Դg%^Xo:xJo5yK,C_q@gOҰyoj@ٛh3Suo :o =g eog|džxŐ~(V 554NC`5ރWm IciJ_7FêvN_ߙɝםO }|J]*Mbo] +ܭ]/dxWJӻp\F]1Me`~3'ȃ)fL17}+Ǝ~l.׌6~}|֌`i {^y>|4LˍׇMj)GJ|ejQco3i2VtpZfӮ4;Gg2odi57g{Vcc7/˅~gEu8lt +-lRhi&[o`7e"IЖ}՝׬r9f\wzgCs1ն~u%,(Eg36`߶wn{FGӺgG](coն_ڭɻ +?ἾoOc#+[{O3ڿ*}oˇ!頲GĹ~udvٙ:1dԯs;!g™xn;KyosO '_+._ @qZUܹzkQ\-'v}w`hS|] =b s׺}bIDϓaNzY$&`)I& , +SdLU֢߳EEv*,Rۡm.k^'|ɢ=x|']%n^>eF#~ر϶wԹyw>}_˥RFߓj i-yOOxzDfؙ$ړ8eM+|<, Mv9Cro)׃͓JPXS~{> .]\4|V)6$6kMlNei00?e. Y93%nTrv6OK|矧X~i[L +f)VHX_AmP b9}/N[XR}ݕ/V , پl l;1愭$CgxxXFUW%U}\=Cpv}GȮՠxc|ik{ϗ +ˇb=2=5rzѭZ7M 4#ZRmNm2<%_KFi [nlUJkl|ɆNLO헀Qގcg:\[ϓyeб;~ +zKhZi:BeZ~%;k3؛5:н&{wnPQ~_7GU˸;۞>\OO OpLgu?ox{Ck~kت~}xطnƎ|KސvLb;\^#ojїh +Ǟ`\m?q3P¤0}L滵ny\55]̷ۙ=>^g2h_tmPjٗ_I!:y+w_"y ,:r?/cx\vlqeͫ|[ Dtb^OȆ"MYuw3nzmqqf2ųoWm'`'=dK5=F\! ~08({g^㑗#糖ze,oq8njTQZL,0Y{9qJF[HE\Bp?*(t|ڍ)C`WXq +H[Ogj'4+Glr-X(;þB߱1(wHQ +/G[7ٸ$~A1MWFuIqajzGQs(zLUg2-JWsjs|6OX{*+afJ況 vA]-qlv]rn{lT''r<5Rhlv̓3PaYcۧޓ#\wBc?h!޵_ sƘždgwz|}K4S,SaBMdLH6 asؓ`WVB Ow% Or.Q$1Dg2.DBYf BtЇzp6Ԕ3+{T`IFf(4L4 dÃzBkP/ZJ-Ip>*nfeh  \j%]d(y+申eE8PXyc< f5g3i?I;-,p\d@ύ-.UkhN`qMS3nJ򔑖VNBhSF +fZ'DLv8 ۙ"pFD;m|]$"ɹe3Fr'_'5IK}iDO-{7j=|Å$KkYLOx$rAH)I>C{z dbVϟN侚Z㉅w.h:ER8#92J{aIsNoO-k~e=2ooIDę:ɠ&}M%QS? OE|{#&@nx̄Ѡ|~ NPpb,r5X(0zqB%n`q5 ?r(h`|rP".`!DBaA:$DGwAI!.90CƟ¯ Y# Y@ܬN",(YQfs舞W*TQcib] G 34-(ZU7GHHJa ,n/G2`c,Yxjk^F̒p=\B(vl;G]W0B[t'iٍd?IlIBR_mGHT%ķE0+]Nh!EbfTrd49gm zI?訚͍#`rj c=}v[1R"fFEoOAJştARmFW^M|Wu';"c2 9՝pN(d6ysqw!Y+)cp`(q~ bݢ|`z_k5q-rh+r!9Ʒ7Tica>1 +d>=$ ൛KNA%-qķb>k: `8+؝U7E3#*~BS{c_ 9O:90tqkdhbtӒ_Agڸ&"?zNNGe q/qjȫ|wJԣ+v#z@})-pЁΟvjDCe28Ev=N f\b.xQ_hixɅNBV;n ć{k|OtdXS@wFDI~ u,_ hJveLKēe&a$pN%#vXCXg|$(NJ0].=n|S3[Mb uADW]6M&L)Nn7;%uH&Cztg^F{ ~XO6X8u }; u_QI,J{$8Od Əq;2#* T}M'],$yBIo5 l$$AGx`~s(`ZզZgʨy^"Eeisy__n< (3;2[w.ҮЉx9i*p@kr {:~Q=ёnvN.19B@$vƅ(v^5]RXذt.)7Fv;Yd|\YC 2OcI8DSZd5}ꑅG=ts@Lx N/ssǛD}k p9>ӥސH }8n2MO|>8ط-V;Xj'2c;֨Ѹ_Ʊ01\G@u'fh84CTVK.d3u'O +)bCh}1,<3]Xڢ- YK)u8ּ 4'fe͌$_bC>d#{>սSEݘ8 G7\tseYHEbj}t)g* p[x‹-L&݋f"pvEקlP%lmeO9[k7؎!lv"j~ +bK]sM2amEMƹmol]Ke/}pU@g$KA1o +/U+.,ze +npT'XM{߷nm8ӽ}ǐ{}ž> gn7ԣ=d2Ƹ=Z:'9Qg#:KPإB 9 +E ӥǗ{﫟1O2 x[`)CDc1nh?<.Gڮl^KF pWGOX"zԧ._%i?>%7`K4ݜ1}ZrԽ!߅14uG|wmxھ-%m0(1n9'h + z=e<L'auL'O߷mCH/59yâ~9Ft;CS5BעP{xgV<YV;f;} +KF"!^qsz +գY5Y~1@$vTԻ1R7[T{9mdlI1»2 V tx{ׯ4Ј޲3M[ јIw)H.7S`>" R&`}v4zҏR@zVjTG9 x6WogD /ҫ&sw@Н9qDoi91by56 +Ĉr!A@mg3ϿW +(Q^G(hvڐZ2\VyF㗚+ZyK^^YhXerckd6Gc"[[ý$жeNX93/=ׇK7Y$Y\EPoDJwIg,P}ksYbniTܮD4-Irb΃6 1rno lC}usjm*u߉gy ]$ +4>TG"y"sAhԙGf(b'Qu; {7MFPjQ%f-n3Z[`a,3(8OOv1{,^Ⱦ ״}Jd"Cicu.ayLρӊn1V_%z?m3i&)v>qSu$dr}|&f45I䟶jw +O7 cӴ߫]R===X};dI=e1Fz[ΞQIi2?}y +#ߡӐi}3Sӏtw/}:H/O7" :gX+)F6 *+VIgfzNb;m{{pL{s*7`>b<EVXF}$}] z9 9 3]\bъ_sW+3X GD@#6~+y +#9JE4|5:4 '`Y M굾g{.>&`)! Ѳsڿ PP @2Z'nz> !Wx㩙6&8B(ӟ2l3S07HCN1pرIy`iwgsN4XqTR )St<Y ;*LIsdU .\*f(=?GmzC/XAğmM#1?^~Djרu m4̼rRx1^JYaᝇ1!?br)[&=9>7 W + X@5QqAtx43Ýynz?$K҂[+ԜzqC1 ?ld}U`{ +%;ItmtKSѓ%4H[++pʢ(恽Ƥa}qc| -83IQ{ʉ9lm=H/WƹhRdj*^?eNU5?\?jbl3n.ꌸ&a&<-87\'ybhe-1|JJ)VNuli䅖orwc%i,7;h4&h1eǓFS.;N4 աH DqE-a("Gq*{ƧbǮk tKaFlX5nJ#|dki "\w߲{=,?$Y +*۲auo5+̺ +,Z]~8?~4!16?_ϐɁ'Ѳ9F#441 N➻nxdY| Nv47K%+8sJIeQlj^ijspH D-+7ȝ,&&4Xi/ߧw5}n*,/| v<6R@isUzSB+ӪdTiݠ/D))In}Ѭo+ O-{~ٔΥwd2+%:/=c?x˓7Fy',Nxho˖6:9J6hea0~Mn4RorʲOn ++,L~nBjMOI~4rT/_T^=.g䂝,zպ}_-y-"}R +E:# 6B,*+)TJ _UhD$$Gch7ħxM:uTs]7Fu1Eךo$ډaݮ P/MTXqK4Qq~KGZ.rqi-egO\ni8sl~cF`AU$ԕT|_]̢5{ #'Mc4Q$GG!<)ڗ(Oj.r7t6*@gsy/%bY"]d\~l5\ 1Ku}Ad+aP +*)ޖ;Ѷwq"Rj}5%dsh[g7'KxH;MJ"(2Qh-ݚoqg2*' |> I"p<*{1˲Z_ڲdǯc%j}vɡSΠ: :9tt8 +9ttl)gCAw-: :WɡSΠ;Yr 9tt“DrT+C' +H>߯1Dtn: 3'pSqH)|"@72Qiw`X O:dl۴x. O 831dQfp?-hKkg|'8,f~9#JsZg .TpdD3Uw/SjdKg ] l9Qb{ɻD]ԞIGE:'?64AɅaʛrG(lZJ ^!ONv +yBFP:﫣C p#ʒS$&yJU>i#%: +XṮ>jzƉUҏTRLndQ<}"/hx,vot1^Yf܍A]$#0$*&$xs#S#8-bYY?HY2i]hHϹ NdW.Ƞ44Ie)e4zdpv##wǝb|%]9%砹j{qQ%F 9% +9eSa܎z> M.d{5RhQ)t>h5+՝JjyuƮ[I1RHTc1n(YcغE~_2p*])9Kg];rI>T*dn>o"T)e^/Y|W·JK~ݪ1Ugp21W·;UC~YX'uv_O~)-Qٵb"Nfox֪+P*Z ܏r֍~~c_P?T"u&ݦuysgsΆ %1 7Nk&kaK*4Rmf vq"bŸXL?$Ber~~{EMg:;vB/mxUTiѝòoWH%*hH%bޫUHGnՅ2RWHm_)#}Զ5put=;n9M>z{vqZAWOygI\˩agPGY%(d/ CC,~ vldTfNBQ[r3gyY| 2@q=)f@s y=?RZ6~=tsߝMGp)e\Hj;ߔ;^t#ك|$۳ԄkZZU͜E|A̕|jPVF%9)wtJr1:r?¥H*àh6YK"OՊOsڸjEI'bmʵ-:G15Rj嗰jf8M'!;sM'e-eI98M'rytR gIul:^dItEl:\:şdI0^kfI½tTiJL_{52w\,d_{0Z_I71`Yx_*XI6Yb.Hj?5]z Tddd/ +":?J3–Z>Q,2ZiVYkPz ]^[^1 +:V4Tm1J9ͣ6G믓{S8ju?s"-5hDuZiB]4IK}y[3&72NR.CNϐTLdbC_C{\ڟe2gagJj`ˇjZ$ǙQO8Ž\υ RZ?Hd%j *lxW2RE#UӖ_ +w7MsqjUS|9 +zAG-Hk*ɳ+IJW(r 59־^bm9~ybm[٪Z7S2WH^Y\1\<3>zQvT.O a"U41}l~Sk5!Uк$&.h6]CV.?xwnh4?Բ~K!ؕ-vz(8_ϳT縊/:bVʻ^kG*dY\|+NluqGmj*+lA3Ӡt2\\)OkGPE{|yg7zѻtʜBقE[&3߭7NPҿ05M\) &#Sn ȥut>yܶ\ M.5M!.ri1^<ɥx۶K“N.&{%IřDHjlh{3Oru` n\ &Ѫ"tb10Ƹ T #-=Qv0|vYvXD[TKv"mfZ΃|b0dH>d3UT+SԦBd5]|߸I%T' T @TēYv欴BjYiSء~@0Iݺ kn WtG/Xy"cH?U(|x +ىܦAJ UR5rTrX߸TND م9P]YG~eSc*'LhHVF/LgLVcˏjUC ?̟,@JYZsoԚx,@;m˲E7,@v4PO\_SOH*Y[?.',eE$pW/ʧV:E 4zQ>Y/UI\(UW74(ݙP\ +\WJ~S4+ %[O+$֓ZOߏ.˯rU?-)dQ-?LkD+\WJDwYJ~-QO3\\՟JGT%_Fwr+;oIWZrI]?tk )^﷥lQO9;e]?07[h.lZ4Gj만I)\ߜ)?wIVڵUdu SL2RՏ-B/z:⬤_S) +nש'GLU?Ō )7Kʱ$uU~^J~^봿(]vO)Ԝe]?.K2ojuIKSVsp)WN=>,\~:]]c/Y\IӖ /A]?dx^lU?99vi]?~_S6ۥ~U~bL[$/I<$8[yuC~U?\ I,,OeT맜+~\O*>V(^PO=uǟU-/Da\.'-E]BµUgŬ(J8a}G*CfZ-V[0*EQ[>ԙv(FdcW~":ۺB=%?f"`&NdDqe(;ue?Aޡh2ev!! C B ! g}[%ɶn +;YaeTAaǣ>|Hv_yC29D{pc|x&g?[ӣW ͇?frkr3'G_.;޽t<L_1$|\]|=$fg϶OnfZ_ib`s|ԋw{cG#x31t'TG!;WxG޽Ol-ܼ^xݧT?>xk!z(??6Ӝx/;/us ŸY0BĞ—SR(bgr:#{Q'&9>B_`Ĭ/99|M:#ڜN~^%{; /w'y:$»Z|l&h1 ,+4' /wua^~`3ɹXL~s:*Arzs4h +V^GQ~V }X3-rv2MVGo7N흭0837x:~~`Dx>#Mj'x{4JUrcO=on_b;ǟ\AaX)MةJ80xױd}?Tls)s>4ͪWێ# [LXiru{' =^;#qꤕګ~[zʃi`\7`0hlç&' &K߳"=]#e2/'D2OHV۶F;":&v&Ɯb@[<δ٣b)!S  "w2s?)ih7 +hsD?ph5rh| >R2y0^t~p/އ^{|ǟYA4mWuѐzץGJ+aIGqQ'`u\%(a⡣K.]*nlʨ^>$ ɪ/wz'w7|Y1JZ|P>'-g?mNwE\)o/jazpv^6qIgU٘cCª{mzjD]UNEͿM=.7V%xKO/hք|P\gg dA66vWuڇ66~w`"naVg,סW=ϧX;F'}6oUov!wFoeUaпه"O\O^,M&+ciNݥ[һ[D oI$7%<,q_KV}K˲DRS~I/zTHbyœ)wC~ꛧ3+Wut7 S[Ȕg'+|Oَ⋋b/[ .姲; }fcjjBWŃŽWk]u]n}~aw*~YL( +F'ߞu7pkq[o[-ԍ햻a |y轒x]n%oJǟy/'hxHG%x$ʫd}[a=۹z:祥Ml:.gNUÄ합tl}8d +f+T4ߓxөb-Ÿzvr[ tLfb3{8;Aߞ~jgC7l.?A~-o|mOw'}JGWƏ_ 6=ܟ#KzxI̷o_ٶ?ֶn~~|-wK1{yebaï-YK9ȡ;SH־ȏ:z円z[&|tK2+B7KoVGN^8r<=,He|SfkI?w瘅~q;a8T6>ܱw+Gf#{t3f-Nqӡ&w=AvWxg vE{~Glӌ2C戜djFc,^437?e-^5-">DZ8Y~6{I*GAfמL?f9ѱbk/ w+ ߙض׶9rvOֻT )-?Wݫ/gC8޽8\vtMkYxi3k|J׾?xh/~>/l_jzax[—Fxmtu8 3_Pߕq_p?ǞƗY~slO%Թ؜l/.vޮ,ړ[K#gǫ;+٧sko>B1| Uv&j~9^w>9a~|:~Ěs[Z_b7XDiÔg\pOb$ߊA?}/_NNLn_|PX +UL?eO7Pm/m'/wuL+4{3U>Ѩ]e hDWgF|'ł7;kɗۇg+;XҾ 歛{凴TMB:ٿ弋XNSH⦉?Mٷ-}O?OypgnRavMdcٗ 7];Gۨ;;+ xXY^~~~iy2_]]y6Ɏ}=hQ퇐Q.+dY[s=U3.)_y-xˉo| +x|{ |utܯ?6<3GHvʞ> kȳq2а#1*+#WrԿ3v۫\Uݙ}ǿ>}=lsUCnf˓,[-|mi+Z=ml6?Y+!][[6ɜ6iX)7ՀSMW2dEaBvR`Ⱥηbfo-N7&+WWO_; l|{"J~${OUqvˢ|&nKM?Z/Fԉy0-d$u`^^#1,+<. dn}U~~~99>@UȯJTcm}WЛs+hvPp' + ;,2H *AmբkHAZoڢU:sëڄ.z[9ڳtDs;eQW;~lԕu鄹p2cv2|Q4A_?) s}L|7Ky<]mŝm{[M6p>|g{{qg{y _kyW者w:ԮA?Wg׾+0);[}]qU]Oݎܭ#2X41=7y!@bpHbH$HHC&BUXI*[qG^ɘBA|1D !cAexRbL`D(!RQ +i 0z6ˁRZRO2-#8gnb4M8MHTKJ=?&#$QiHHax,&yKVF+ds O"HjI +~"zZ(瘀Y) yg\V +\# Ղ!%"$K) j^+#:/)A9|Hخդߐ!Ȗ#:pX0eh`wÅ`pip &&QXÀDCPD4WbD7 .Ʌvh$80 %-8TQp)$OpE;n'E)TUǠ^չ4\^lq4^zcI0kE +é +A ([t,%AWI.@o녴UvU*`d C=++_^,A0!+>lLpy0B32"s/0N" rb{7(s0=N{)T! h~i ~r? kXG.ĘBbA &j*hRIM2 +X}.&G`c!&xY.eBLFI\@Y͖b;P&? +"cXPE4}M7q@ $DցbB % 2,i $o\B1 z  pJMu8a #Pv\ +2FJU5'A Wيԗc1 XU$(Aӟḵ *ˁak3pqDs hD85z7s0(j4=_R).>HyOC”b. AbABCL|DPLń% 3}L-@UfK8U&6%J +]eq@ LRS&ADÂR' +]u4Aϭn3DN, NL +nTE;3 +B}J̳!.cj ʼnI2Ф +$2Sj&f"LNyOK!1LlA%lfVrA2{ }d@9hV0?TY3׭EpBpqM +PXf~ݧ;O'_#x,83qZG8VBf)̾p!€T2#NUj],6-5 e! \QBUXzBC5Rӹjda$$$koX- La@S=r<1LVD"COUs-0`^' +.$!XD4զ{9NBPWkLSH%B,aWzW9S+[!ϼ3bNdklU@J\,:[M)Ę3S#N GwSDr *,HS + | | | | | | |jn D}"AE|bB@!?@ L0Lp`&-G&2Lp`n ]!?Lp`Bu9v' &8B^0A L(e؜LpL &86܆`%?W="uHL 5p p.&`R b8 !/ `7 & (\/P& `&sY L(,qXLpLpWLpVLpֺLp}Lp=L a0HL a0=`&:`BaG&:`& Lpd|` `# +- UztA0 `#zgtA0϶`ےL=_P0 La0AdLa0AdLa0AdLPa0ATLPa0ATLPa0ATLPa0A(B`b `"80 NL >&: &` ̩ x0 RH0' Lp/P!0 * &0  ` + U%c`P &hc0'&`48Lp%`BI& =e{7B&Bh;A``Buttnp;* LPa0AT0A=D? +yט`+ Yz3? | | | | | | | |>h>h>h4A ":`#-B`+}g1Lpz!? EK~0 δW&`&`kN^0 ՙ6x۝`/yQL&8B^0?ڜL5UL5K^0 ՙ6sxep L &&C`ޚ + *&:` + * &` + 2 &:`\`#d0Ad0AT0Ad0Ad0u?YLA0AULPa0AULPA0_>0u^0u& j P0  `PxW&+h&8B^0ђLpUT0AyW&T  P=_P0 La0xLa0xLa0xLa0ADLa0ADLa0ADLa0AdLa0AdLa0AdLa0ATLPa0ATLPa0ATL:&I 0nLp +P &Tc? &:` " &:`&:`&0 `BUj *&0 2 & j Uѽ`B!4LPuUL(0|~0:{:7}G&0   j yYz3? | | | | | | | |>h>h>h4A JZEk?Y?@ UI1AbtqdhE<!? DDp "-AG"2Dp ": "8!?P{js} D`u@A #i"86x AxDp BuV: 2 " "": " " < ": \ #xAxAADAAxAxu?A^DAAAQDaAAQDaAAYDAAAoA!?P$~ +"8D(4DpTDAAG"TP=_PDahDahDahD`aXD`aXD`aXD`axDaxDaxDaDDaADDaADDaAdDp +xA71  , "0PU?" " ": <": " BU8sT?P DAr6Dp<DMmG~, ": ": ": ": cq~5K/P{fq@ԃ@'cx΋'ó 0L1 +|1nspΨwD .QAϯ4A$L((&)'xڂ +pD8;TJS^|hP)Ud(+2R/ER7؛{fnl 56nb:v)n=`ڞYV%Neai ~Fyn'([j)NK`FFv+kqMYe @J #Q 26)͖R˃yƍrKڡ4ږ^2P"* +|晷{R!ujy'Y`.aj;)d`J˪0׃S$7<.ѱP"^'P +!0bq[_:XIR=CtEp7ضTM@HTeTwjjjc\7Ol؆x1"47g@슘tmYn +Za!SMnj{@B٩v $ZJr'Hvv'MA;Dӈe,~rdf,ѱ &WAb +ܦlgiOdS)w mgDڠ zMȱ ԗ†q +Oa«0V12D}i("B=ʰ#~`-Dd)B},ZP)1'S2L^++40S +^aͦzZ +2,}Jq-a=i1`FG5fq@gGƳdn%FOȹV0Yz +^llll{0 ,` a bn~h:׮#(XDPFhogip#k3a U%Pg&scvs)֬CI,!HLK6!76  fF_* 0;e2wp ?#rX2#1!u&6ɝ`ƆPdw)Z}Y~Qpoza"G!DXlCTv3ʡ=S4! +])jj;d>iI$dT.$2Befl;⣝a{> T Y5 +HrhDOTv!$T9 &ep@Y.`u-MfED"r+ 08jyS\"%c( 9eWJҫ +As¦!Ӓ~^X߻uJ]pRF`&^LeܘPA3&DвsJͅeE`vm节.4K jĬbԃvq*kV5uo`5rLj +'98aƜvнh=ۦ7ٜ8%r= %Y @;_K4x`nngG6F +nUO &,Oe5,N7F(3n3JAqYD)rg!mhҞ>ԁn`nl7l9OTM \ MeDfiqNm\#6Tޛ{{{{{n4> +)SҕagLԺ2w%=Bl,H 5Hz7-cVYcX6jPpyUw*yZ JbEӴz9YJ A˜rQACP*x|6z0]5P#T晹{8^+G^MO;G_oλWC_:?֗Uu?|%oWWH endstream endobj 21 0 obj [/ICCBased 27 0 R] endobj 7 0 obj [6 0 R 5 0 R] endobj 40 0 obj <> endobj xref 0 41 0000000000 65535 f +0000000016 00000 n +0000000156 00000 n +0000038280 00000 n +0000000000 00000 f +0000053108 00000 n +0000053178 00000 n +0000378446 00000 n +0000038331 00000 n +0000038793 00000 n +0000041265 00000 n +0000053839 00000 n +0000050299 00000 n +0000050186 00000 n +0000053480 00000 n +0000053603 00000 n +0000053716 00000 n +0000042272 00000 n +0000044889 00000 n +0000047506 00000 n +0000041327 00000 n +0000378411 00000 n +0000041711 00000 n +0000041759 00000 n +0000053045 00000 n +0000052982 00000 n +0000050123 00000 n +0000050334 00000 n +0000053364 00000 n +0000053395 00000 n +0000053248 00000 n +0000053279 00000 n +0000053913 00000 n +0000054175 00000 n +0000055286 00000 n +0000067808 00000 n +0000133396 00000 n +0000198984 00000 n +0000264572 00000 n +0000330160 00000 n +0000378475 00000 n +trailer <<0C9D12E6EE994682A6EAD56912419B86>]>> startxref 378666 %%EOF \ No newline at end of file diff --git a/resources/identity.svg b/resources/identity.svg new file mode 100644 index 0000000000..b363971cef --- /dev/null +++ b/resources/identity.svg @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/jest.d.ts b/resources/jest.d.ts deleted file mode 100644 index 7d4410bf91..0000000000 --- a/resources/jest.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -declare var jasmine: any; - -declare function afterEach(fn: any): any; -declare function beforeEach(fn: any): any; -declare function describe(name: string, fn: any): void; -declare var it: { - (name: string, fn: any): void; - only: (name: string, fn: any) => void; -} -declare function expect(val: any): Expect; -declare var jest: Jest; -declare function pit(name: string, fn: any): void; -declare function xdescribe(name: string, fn: any): void; -declare function xit(name: string, fn: any): void; - -interface Expect { - not: Expect - toThrow(message?: string): void - toBe(value: any): void - toEqual(value: any): void - toBeFalsy(): void - toBeTruthy(): void - toBeNull(): void - toBeUndefined(): void - toBeDefined(): void - toMatch(regexp: RegExp): void - toContain(string: string): void - toBeCloseTo(number: number, delta: number): void - toBeGreaterThan(number: number): void - toBeLessThan(number: number): void - toBeCalled(): void - toBeCalledWith(...arguments): void - lastCalledWith(...arguments): void -} - -interface Jest { - autoMockOff(): void - autoMockOn(): void - clearAllTimers(): void - dontMock(moduleName: string): void - genMockFromModule(moduleObj: Object): Object - genMockFunction(): MockFunction - genMockFn(): MockFunction - mock(moduleName: string): void - runAllTicks(): void - runAllTimers(): void - runOnlyPendingTimers(): void - setMock(moduleName: string, moduleExports: Object): void -} - -interface MockFunction { - (...arguments): any - mock: { - calls: Array> - instances: Array - } - mockClear(): void - mockImplementation(fn: Function): MockFunction - mockImpl(fn: Function): MockFunction - mockReturnThis(): MockFunction - mockReturnValue(value: any): MockFunction - mockReturnValueOnce(value: any): MockFunction -} - -// Allow importing jasmine-check -declare module 'jasmine-check' { - export function install(global?: any): void; -} -declare var check: any; -declare var gen: any; diff --git a/resources/jestPreprocessor.js b/resources/jestPreprocessor.js index 8866b79694..5ea6aa5036 100644 --- a/resources/jestPreprocessor.js +++ b/resources/jestPreprocessor.js @@ -1,68 +1,71 @@ -// preprocessor.js -var fs = require('fs'); -var path = require('path'); var typescript = require('typescript'); -var react = require('react-tools'); +const makeSynchronous = require('make-synchronous'); -var CACHE_DIR = path.join(path.resolve(__dirname + '/../build')); +const TYPESCRIPT_OPTIONS = { + noEmitOnError: true, + target: typescript.ScriptTarget.ES2015, + module: typescript.ModuleKind.CommonJS, + strictNullChecks: true, + sourceMap: true, + inlineSourceMap: true, +}; -function isFileNewer(a, b) { - try { - return fs.statSync(a).mtime > fs.statSync(b).mtime; - } catch (ex) { - return false; - } +function transpileTypeScript(src, path) { + return typescript.transpile(src, TYPESCRIPT_OPTIONS, path, []); } -function compileTypeScript(filePath) { - var options = { - outDir: CACHE_DIR, - noEmitOnError: true, - target: typescript.ScriptTarget.ES5, - module: typescript.ModuleKind.CommonJS - }; - - // re-use cached source if possible - var outputPath = path.join(options.outDir, path.basename(filePath, '.ts')) + '.js'; - if (isFileNewer(outputPath, filePath)) { - return fs.readFileSync(outputPath, {encoding: 'utf8'}); - } +function transpileJavaScript(src, path) { + // Need to make this sync by calling `makeSynchronous` + // while https://github.com/facebook/jest/issues/9504 is not resolved + const fn = makeSynchronous(async (path) => { + const rollup = require('rollup'); + const buble = require('@rollup/plugin-buble'); + const commonjs = require('@rollup/plugin-commonjs'); + const json = require('@rollup/plugin-json'); + const typescript = require('@rollup/plugin-typescript'); - if (fs.existsSync(outputPath)) { - fs.unlinkSync(outputPath); - } + // same input options as in rollup-config.js + const inputOptions = { + input: path, + onwarn: () => {}, + plugins: [commonjs(), json(), typescript(), buble()], + }; - var host = typescript.createCompilerHost(options); - var program = typescript.createProgram([filePath], options, host); - var checker = typescript.createTypeChecker(program, /*fullTypeCheck*/ true); - var result = checker.emitFiles(); + const bundle = await rollup.rollup(inputOptions); - program.getDiagnostics() - .concat(checker.getDiagnostics()) - .concat(result.diagnostics) - .forEach(function(diagnostic) { - var lineChar = diagnostic.file.getLineAndCharacterFromPosition(diagnostic.start); - console.error('%s %d:%d %s', diagnostic.file.filename, lineChar.line, lineChar.character, diagnostic.messageText); + const { output } = await bundle.generate({ + file: path, + format: 'cjs', + sourcemap: true, }); - if (result.emitResultStatus !== typescript.EmitReturnStatus.Succeeded) { - throw new Error('Compiling ' + filePath + ' failed'); - } + await bundle.close(); + + const { code, map } = output[0]; + + if (!code) { + throw new Error( + 'Unable to get code from rollup output in jestPreprocessor. Did rollup version changed ?' + ); + } + + return { code, map }; + }); - return fs.readFileSync(outputPath, {encoding: 'utf8'}); + return fn(path); } module.exports = { - process: function(src, filePath) { - if (filePath.match(/\.ts$/) && !filePath.match(/\.d\.ts$/)) { - return compileTypeScript(filePath); - } else if (filePath.match(/\.js$/) && ~filePath.indexOf('/__tests__/')) { - var result = react.transform(src, {harmony: true}).replace( - /require\('immutable/g, - "require('" + path.relative(path.dirname(filePath), process.cwd()) - ); - return result; + process(src, path) { + if (path.endsWith('.ts') || path.endsWith('.tsx')) { + return { code: transpileTypeScript(src, path) }; } - return src; - } + + return transpileJavaScript(src, path); + }, + + getCacheKey() { + // ignore cache, as there is a conflict between rollup compile and jest preprocessor. + return Date.now().toString(); + }, }; diff --git a/resources/jestResolver.js b/resources/jestResolver.js new file mode 100644 index 0000000000..a379bc4421 --- /dev/null +++ b/resources/jestResolver.js @@ -0,0 +1,17 @@ +const path = require('path'); +const pkg = require('../package.json'); + +module.exports = (request, options) => { + if (request === 'immutable') { + if (process.env.CI) { + // In CI environment, test the real built file to be sure that the build is not broken + return path.resolve(options.rootDir, pkg.main); + } + + // In development mode, we want sourcemaps, live reload, etc., so point to the src/ directory + return `${options.rootDir}/src/Immutable.js`; + } + + // Call the defaultResolver, if we want to load non-immutable + return options.defaultResolver(request, options); +}; diff --git a/resources/node_test.sh b/resources/node_test.sh deleted file mode 100755 index f1d8b56081..0000000000 --- a/resources/node_test.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# Run all tests using jest -if [[ $TRAVIS ]] -then jest -i # Travis tests are run inline -else jest -fi diff --git a/resources/prepare-dist.sh b/resources/prepare-dist.sh new file mode 100755 index 0000000000..d8d86a0573 --- /dev/null +++ b/resources/prepare-dist.sh @@ -0,0 +1,25 @@ +#!/bin/sh -e + +# This script prepares an npm directory with files safe to publish to npm or the +# npm git branch: +# +# "immutable": "git://github.com/immutable-js/immutable-js.git#npm" +# + +# Create empty npm directory +rm -rf npm +mkdir -p npm + +# Copy over necessary files +cp -r dist npm/ +cp README.md npm/ +cp LICENSE npm/ + +# Ensure a vanilla package.json before deploying so other tools do not interpret +# The built output as requiring any further transformation. +node -e "var package = require('./package.json'); \ + package = Object.fromEntries(Object.entries(package).filter(([key]) => package.publishKeys.includes(key))); \ + require('fs').writeFileSync('./npm/package.json', JSON.stringify(package, null, 2));" + +# Retain marginal support for bower on the npm branch +cp npm/package.json npm/bower.json diff --git a/resources/react-global.js b/resources/react-global.js new file mode 100644 index 0000000000..45b0fd0871 --- /dev/null +++ b/resources/react-global.js @@ -0,0 +1 @@ +module.exports = global.React; diff --git a/resources/rollup-config.mjs b/resources/rollup-config.mjs new file mode 100644 index 0000000000..6963235c5d --- /dev/null +++ b/resources/rollup-config.mjs @@ -0,0 +1,47 @@ +import path from 'path'; +import buble from '@rollup/plugin-buble'; +import commonjs from '@rollup/plugin-commonjs'; +import json from '@rollup/plugin-json'; +import terser from '@rollup/plugin-terser'; +// TODO replace @rollup/plugin-typescript with babel after babel migration +import typescript from '@rollup/plugin-typescript'; +import copyright from './copyright.mjs'; + +const SRC_DIR = path.resolve('src'); +const DIST_DIR = path.resolve('dist'); + +export default [ + { + input: path.join(SRC_DIR, 'Immutable.js'), + plugins: [commonjs(), json(), typescript(), buble()], + output: [ + // umd build + { + banner: copyright, + name: 'Immutable', + exports: 'named', + file: path.join(DIST_DIR, 'immutable.js'), + format: 'umd', + sourcemap: false, + }, + // minified build for browsers + { + banner: copyright, + name: 'Immutable', + exports: 'named', + file: path.join(DIST_DIR, 'immutable.min.js'), + format: 'umd', + sourcemap: false, + plugins: [terser()], + }, + // es build for bundlers and node + { + banner: copyright, + name: 'Immutable', + file: path.join(DIST_DIR, 'immutable.es.js'), + format: 'es', + sourcemap: false, + }, + ], + }, +]; diff --git a/resources/stripCopyright.js b/resources/stripCopyright.js deleted file mode 100644 index 39ba85defc..0000000000 --- a/resources/stripCopyright.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -var fs = require('fs'); - -function stripCopyright(source) { - var copyright = getCopyright(); - var position = source.indexOf(copyright); - if (position === -1) { - return source; - } - return source.slice(0, position) + source.slice(position + copyright.length); -} - -var _copyright; -function getCopyright() { - return _copyright || (_copyright = fs.readFileSync('resources/COPYRIGHT')); -} - -module.exports = stripCopyright; diff --git a/src/Collection.js b/src/Collection.js index a24ee4229c..650ff654ff 100644 --- a/src/Collection.js +++ b/src/Collection.js @@ -1,27 +1,36 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { Iterable } from './Iterable' - - -export class Collection extends Iterable { - constructor() { - throw TypeError('Abstract'); +import { Seq, KeyedSeq, IndexedSeq, SetSeq } from './Seq'; +import { isCollection } from './predicates/isCollection'; +import { isKeyed } from './predicates/isKeyed'; +import { isIndexed } from './predicates/isIndexed'; +import { isAssociative } from './predicates/isAssociative'; + +export class Collection { + constructor(value) { + // eslint-disable-next-line no-constructor-return + return isCollection(value) ? value : Seq(value); } } -export class KeyedCollection extends Collection {} - -export class IndexedCollection extends Collection {} +export class KeyedCollection extends Collection { + constructor(value) { + // eslint-disable-next-line no-constructor-return + return isKeyed(value) ? value : KeyedSeq(value); + } +} -export class SetCollection extends Collection {} +export class IndexedCollection extends Collection { + constructor(value) { + // eslint-disable-next-line no-constructor-return + return isIndexed(value) ? value : IndexedSeq(value); + } +} +export class SetCollection extends Collection { + constructor(value) { + // eslint-disable-next-line no-constructor-return + return isCollection(value) && !isAssociative(value) ? value : SetSeq(value); + } +} Collection.Keyed = KeyedCollection; Collection.Indexed = IndexedCollection; diff --git a/src/CollectionImpl.js b/src/CollectionImpl.js new file mode 100644 index 0000000000..befb3dadc2 --- /dev/null +++ b/src/CollectionImpl.js @@ -0,0 +1,789 @@ +import { + Collection, + KeyedCollection, + IndexedCollection, + SetCollection, +} from './Collection'; +import { IS_COLLECTION_SYMBOL } from './predicates/isCollection'; +import { isKeyed, IS_KEYED_SYMBOL } from './predicates/isKeyed'; +import { isIndexed, IS_INDEXED_SYMBOL } from './predicates/isIndexed'; +import { isOrdered, IS_ORDERED_SYMBOL } from './predicates/isOrdered'; +import { is } from './is'; +import { + NOT_SET, + ensureSize, + wrapIndex, + returnTrue, + resolveBegin, +} from './TrieUtils'; +import { hash } from './Hash'; +import { imul, smi } from './Math'; +import { + Iterator, + ITERATOR_SYMBOL, + ITERATE_KEYS, + ITERATE_VALUES, + ITERATE_ENTRIES, +} from './Iterator'; + +import arrCopy from './utils/arrCopy'; +import assertNotInfinite from './utils/assertNotInfinite'; +import deepEqual from './utils/deepEqual'; +import mixin from './utils/mixin'; +import quoteString from './utils/quoteString'; + +import { toJS } from './toJS'; +import { Map } from './Map'; +import { OrderedMap } from './OrderedMap'; +import { List } from './List'; +import { Set } from './Set'; +import { OrderedSet } from './OrderedSet'; +import { Stack } from './Stack'; +import { Range } from './Range'; +import { KeyedSeq, IndexedSeq, SetSeq, ArraySeq } from './Seq'; +import { + reify, + ToKeyedSequence, + ToIndexedSequence, + ToSetSequence, + FromEntriesSequence, + flipFactory, + mapFactory, + reverseFactory, + filterFactory, + countByFactory, + groupByFactory, + sliceFactory, + takeWhileFactory, + skipWhileFactory, + concatFactory, + flattenFactory, + flatMapFactory, + interposeFactory, + sortFactory, + maxFactory, + zipWithFactory, + partitionFactory, +} from './Operations'; +import { getIn } from './methods/getIn'; +import { hasIn } from './methods/hasIn'; +import { toObject } from './methods/toObject'; + +export { Collection, CollectionPrototype, IndexedCollectionPrototype }; + +Collection.Iterator = Iterator; + +mixin(Collection, { + // ### Conversion to other types + + toArray() { + assertNotInfinite(this.size); + const array = new Array(this.size || 0); + const useTuples = isKeyed(this); + let i = 0; + this.__iterate((v, k) => { + // Keyed collections produce an array of tuples. + array[i++] = useTuples ? [k, v] : v; + }); + return array; + }, + + toIndexedSeq() { + return new ToIndexedSequence(this); + }, + + toJS() { + return toJS(this); + }, + + toKeyedSeq() { + return new ToKeyedSequence(this, true); + }, + + toMap() { + // Use Late Binding here to solve the circular dependency. + return Map(this.toKeyedSeq()); + }, + + toObject: toObject, + + toOrderedMap() { + // Use Late Binding here to solve the circular dependency. + return OrderedMap(this.toKeyedSeq()); + }, + + toOrderedSet() { + // Use Late Binding here to solve the circular dependency. + return OrderedSet(isKeyed(this) ? this.valueSeq() : this); + }, + + toSet() { + // Use Late Binding here to solve the circular dependency. + return Set(isKeyed(this) ? this.valueSeq() : this); + }, + + toSetSeq() { + return new ToSetSequence(this); + }, + + toSeq() { + return isIndexed(this) + ? this.toIndexedSeq() + : isKeyed(this) + ? this.toKeyedSeq() + : this.toSetSeq(); + }, + + toStack() { + // Use Late Binding here to solve the circular dependency. + return Stack(isKeyed(this) ? this.valueSeq() : this); + }, + + toList() { + // Use Late Binding here to solve the circular dependency. + return List(isKeyed(this) ? this.valueSeq() : this); + }, + + // ### Common JavaScript methods and properties + + toString() { + return '[Collection]'; + }, + + __toString(head, tail) { + if (this.size === 0) { + return head + tail; + } + return ( + head + + ' ' + + this.toSeq().map(this.__toStringMapper).join(', ') + + ' ' + + tail + ); + }, + + // ### ES6 Collection methods (ES6 Array and Map) + + concat(...values) { + return reify(this, concatFactory(this, values)); + }, + + includes(searchValue) { + return this.some((value) => is(value, searchValue)); + }, + + entries() { + return this.__iterator(ITERATE_ENTRIES); + }, + + every(predicate, context) { + assertNotInfinite(this.size); + let returnValue = true; + this.__iterate((v, k, c) => { + if (!predicate.call(context, v, k, c)) { + returnValue = false; + return false; + } + }); + return returnValue; + }, + + filter(predicate, context) { + return reify(this, filterFactory(this, predicate, context, true)); + }, + + partition(predicate, context) { + return partitionFactory(this, predicate, context); + }, + + find(predicate, context, notSetValue) { + const entry = this.findEntry(predicate, context); + return entry ? entry[1] : notSetValue; + }, + + forEach(sideEffect, context) { + assertNotInfinite(this.size); + return this.__iterate(context ? sideEffect.bind(context) : sideEffect); + }, + + join(separator) { + assertNotInfinite(this.size); + separator = separator !== undefined ? '' + separator : ','; + let joined = ''; + let isFirst = true; + this.__iterate((v) => { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + isFirst ? (isFirst = false) : (joined += separator); + joined += v !== null && v !== undefined ? v.toString() : ''; + }); + return joined; + }, + + keys() { + return this.__iterator(ITERATE_KEYS); + }, + + map(mapper, context) { + return reify(this, mapFactory(this, mapper, context)); + }, + + reduce(reducer, initialReduction, context) { + return reduce( + this, + reducer, + initialReduction, + context, + arguments.length < 2, + false + ); + }, + + reduceRight(reducer, initialReduction, context) { + return reduce( + this, + reducer, + initialReduction, + context, + arguments.length < 2, + true + ); + }, + + reverse() { + return reify(this, reverseFactory(this, true)); + }, + + slice(begin, end) { + return reify(this, sliceFactory(this, begin, end, true)); + }, + + some(predicate, context) { + assertNotInfinite(this.size); + let returnValue = false; + this.__iterate((v, k, c) => { + if (predicate.call(context, v, k, c)) { + returnValue = true; + return false; + } + }); + return returnValue; + }, + + sort(comparator) { + return reify(this, sortFactory(this, comparator)); + }, + + values() { + return this.__iterator(ITERATE_VALUES); + }, + + // ### More sequential methods + + butLast() { + return this.slice(0, -1); + }, + + isEmpty() { + return this.size !== undefined ? this.size === 0 : !this.some(() => true); + }, + + count(predicate, context) { + return ensureSize( + predicate ? this.toSeq().filter(predicate, context) : this + ); + }, + + countBy(grouper, context) { + return countByFactory(this, grouper, context); + }, + + equals(other) { + return deepEqual(this, other); + }, + + entrySeq() { + // eslint-disable-next-line @typescript-eslint/no-this-alias + const collection = this; + if (collection._cache) { + // We cache as an entries array, so we can just return the cache! + return new ArraySeq(collection._cache); + } + const entriesSequence = collection.toSeq().map(entryMapper).toIndexedSeq(); + entriesSequence.fromEntrySeq = () => collection.toSeq(); + return entriesSequence; + }, + + filterNot(predicate, context) { + return this.filter(not(predicate), context); + }, + + findEntry(predicate, context, notSetValue) { + let found = notSetValue; + this.__iterate((v, k, c) => { + if (predicate.call(context, v, k, c)) { + found = [k, v]; + return false; + } + }); + return found; + }, + + findKey(predicate, context) { + const entry = this.findEntry(predicate, context); + return entry && entry[0]; + }, + + findLast(predicate, context, notSetValue) { + return this.toKeyedSeq().reverse().find(predicate, context, notSetValue); + }, + + findLastEntry(predicate, context, notSetValue) { + return this.toKeyedSeq() + .reverse() + .findEntry(predicate, context, notSetValue); + }, + + findLastKey(predicate, context) { + return this.toKeyedSeq().reverse().findKey(predicate, context); + }, + + first(notSetValue) { + return this.find(returnTrue, null, notSetValue); + }, + + flatMap(mapper, context) { + return reify(this, flatMapFactory(this, mapper, context)); + }, + + flatten(depth) { + return reify(this, flattenFactory(this, depth, true)); + }, + + fromEntrySeq() { + return new FromEntriesSequence(this); + }, + + get(searchKey, notSetValue) { + return this.find((_, key) => is(key, searchKey), undefined, notSetValue); + }, + + getIn: getIn, + + groupBy(grouper, context) { + return groupByFactory(this, grouper, context); + }, + + has(searchKey) { + return this.get(searchKey, NOT_SET) !== NOT_SET; + }, + + hasIn: hasIn, + + isSubset(iter) { + iter = typeof iter.includes === 'function' ? iter : Collection(iter); + return this.every((value) => iter.includes(value)); + }, + + isSuperset(iter) { + iter = typeof iter.isSubset === 'function' ? iter : Collection(iter); + return iter.isSubset(this); + }, + + keyOf(searchValue) { + return this.findKey((value) => is(value, searchValue)); + }, + + keySeq() { + return this.toSeq().map(keyMapper).toIndexedSeq(); + }, + + last(notSetValue) { + return this.toSeq().reverse().first(notSetValue); + }, + + lastKeyOf(searchValue) { + return this.toKeyedSeq().reverse().keyOf(searchValue); + }, + + max(comparator) { + return maxFactory(this, comparator); + }, + + maxBy(mapper, comparator) { + return maxFactory(this, comparator, mapper); + }, + + min(comparator) { + return maxFactory( + this, + comparator ? neg(comparator) : defaultNegComparator + ); + }, + + minBy(mapper, comparator) { + return maxFactory( + this, + comparator ? neg(comparator) : defaultNegComparator, + mapper + ); + }, + + rest() { + return this.slice(1); + }, + + skip(amount) { + return amount === 0 ? this : this.slice(Math.max(0, amount)); + }, + + skipLast(amount) { + return amount === 0 ? this : this.slice(0, -Math.max(0, amount)); + }, + + skipWhile(predicate, context) { + return reify(this, skipWhileFactory(this, predicate, context, true)); + }, + + skipUntil(predicate, context) { + return this.skipWhile(not(predicate), context); + }, + + sortBy(mapper, comparator) { + return reify(this, sortFactory(this, comparator, mapper)); + }, + + take(amount) { + return this.slice(0, Math.max(0, amount)); + }, + + takeLast(amount) { + return this.slice(-Math.max(0, amount)); + }, + + takeWhile(predicate, context) { + return reify(this, takeWhileFactory(this, predicate, context)); + }, + + takeUntil(predicate, context) { + return this.takeWhile(not(predicate), context); + }, + + update(fn) { + return fn(this); + }, + + valueSeq() { + return this.toIndexedSeq(); + }, + + // ### Hashable Object + + hashCode() { + return this.__hash || (this.__hash = hashCollection(this)); + }, + + // ### Internal + + // abstract __iterate(fn, reverse) + + // abstract __iterator(type, reverse) +}); + +const CollectionPrototype = Collection.prototype; +CollectionPrototype[IS_COLLECTION_SYMBOL] = true; +CollectionPrototype[ITERATOR_SYMBOL] = CollectionPrototype.values; +CollectionPrototype.toJSON = CollectionPrototype.toArray; +CollectionPrototype.__toStringMapper = quoteString; +CollectionPrototype.inspect = CollectionPrototype.toSource = function () { + return this.toString(); +}; +CollectionPrototype.chain = CollectionPrototype.flatMap; +CollectionPrototype.contains = CollectionPrototype.includes; + +mixin(KeyedCollection, { + // ### More sequential methods + + flip() { + return reify(this, flipFactory(this)); + }, + + mapEntries(mapper, context) { + let iterations = 0; + return reify( + this, + this.toSeq() + .map((v, k) => mapper.call(context, [k, v], iterations++, this)) + .fromEntrySeq() + ); + }, + + mapKeys(mapper, context) { + return reify( + this, + this.toSeq() + .flip() + .map((k, v) => mapper.call(context, k, v, this)) + .flip() + ); + }, +}); + +const KeyedCollectionPrototype = KeyedCollection.prototype; +KeyedCollectionPrototype[IS_KEYED_SYMBOL] = true; +KeyedCollectionPrototype[ITERATOR_SYMBOL] = CollectionPrototype.entries; +KeyedCollectionPrototype.toJSON = toObject; +KeyedCollectionPrototype.__toStringMapper = (v, k) => + quoteString(k) + ': ' + quoteString(v); + +mixin(IndexedCollection, { + // ### Conversion to other types + + toKeyedSeq() { + return new ToKeyedSequence(this, false); + }, + + // ### ES6 Collection methods (ES6 Array and Map) + + filter(predicate, context) { + return reify(this, filterFactory(this, predicate, context, false)); + }, + + findIndex(predicate, context) { + const entry = this.findEntry(predicate, context); + return entry ? entry[0] : -1; + }, + + indexOf(searchValue) { + const key = this.keyOf(searchValue); + return key === undefined ? -1 : key; + }, + + lastIndexOf(searchValue) { + const key = this.lastKeyOf(searchValue); + return key === undefined ? -1 : key; + }, + + reverse() { + return reify(this, reverseFactory(this, false)); + }, + + slice(begin, end) { + return reify(this, sliceFactory(this, begin, end, false)); + }, + + splice(index, removeNum /*, ...values*/) { + const numArgs = arguments.length; + removeNum = Math.max(removeNum || 0, 0); + if (numArgs === 0 || (numArgs === 2 && !removeNum)) { + return this; + } + // If index is negative, it should resolve relative to the size of the + // collection. However size may be expensive to compute if not cached, so + // only call count() if the number is in fact negative. + index = resolveBegin(index, index < 0 ? this.count() : this.size); + const spliced = this.slice(0, index); + return reify( + this, + numArgs === 1 + ? spliced + : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)) + ); + }, + + // ### More collection methods + + findLastIndex(predicate, context) { + const entry = this.findLastEntry(predicate, context); + return entry ? entry[0] : -1; + }, + + first(notSetValue) { + return this.get(0, notSetValue); + }, + + flatten(depth) { + return reify(this, flattenFactory(this, depth, false)); + }, + + get(index, notSetValue) { + index = wrapIndex(this, index); + return index < 0 || + this.size === Infinity || + (this.size !== undefined && index > this.size) + ? notSetValue + : this.find((_, key) => key === index, undefined, notSetValue); + }, + + has(index) { + index = wrapIndex(this, index); + return ( + index >= 0 && + (this.size !== undefined + ? this.size === Infinity || index < this.size + : this.indexOf(index) !== -1) + ); + }, + + interpose(separator) { + return reify(this, interposeFactory(this, separator)); + }, + + interleave(/*...collections*/) { + const collections = [this].concat(arrCopy(arguments)); + const zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, collections); + const interleaved = zipped.flatten(true); + if (zipped.size) { + interleaved.size = zipped.size * collections.length; + } + return reify(this, interleaved); + }, + + keySeq() { + return Range(0, this.size); + }, + + last(notSetValue) { + return this.get(-1, notSetValue); + }, + + skipWhile(predicate, context) { + return reify(this, skipWhileFactory(this, predicate, context, false)); + }, + + zip(/*, ...collections */) { + const collections = [this].concat(arrCopy(arguments)); + return reify(this, zipWithFactory(this, defaultZipper, collections)); + }, + + zipAll(/*, ...collections */) { + const collections = [this].concat(arrCopy(arguments)); + return reify(this, zipWithFactory(this, defaultZipper, collections, true)); + }, + + zipWith(zipper /*, ...collections */) { + const collections = arrCopy(arguments); + collections[0] = this; + return reify(this, zipWithFactory(this, zipper, collections)); + }, +}); + +const IndexedCollectionPrototype = IndexedCollection.prototype; +IndexedCollectionPrototype[IS_INDEXED_SYMBOL] = true; +IndexedCollectionPrototype[IS_ORDERED_SYMBOL] = true; + +mixin(SetCollection, { + // ### ES6 Collection methods (ES6 Array and Map) + + get(value, notSetValue) { + return this.has(value) ? value : notSetValue; + }, + + includes(value) { + return this.has(value); + }, + + // ### More sequential methods + + keySeq() { + return this.valueSeq(); + }, +}); + +const SetCollectionPrototype = SetCollection.prototype; +SetCollectionPrototype.has = CollectionPrototype.includes; +SetCollectionPrototype.contains = SetCollectionPrototype.includes; +SetCollectionPrototype.keys = SetCollectionPrototype.values; + +// Mixin subclasses + +mixin(KeyedSeq, KeyedCollectionPrototype); +mixin(IndexedSeq, IndexedCollectionPrototype); +mixin(SetSeq, SetCollectionPrototype); + +// #pragma Helper functions + +function reduce(collection, reducer, reduction, context, useFirst, reverse) { + assertNotInfinite(collection.size); + collection.__iterate((v, k, c) => { + if (useFirst) { + useFirst = false; + reduction = v; + } else { + reduction = reducer.call(context, reduction, v, k, c); + } + }, reverse); + return reduction; +} + +function keyMapper(v, k) { + return k; +} + +function entryMapper(v, k) { + return [k, v]; +} + +function not(predicate) { + return function () { + return !predicate.apply(this, arguments); + }; +} + +function neg(predicate) { + return function () { + return -predicate.apply(this, arguments); + }; +} + +function defaultZipper() { + return arrCopy(arguments); +} + +function defaultNegComparator(a, b) { + return a < b ? 1 : a > b ? -1 : 0; +} + +function hashCollection(collection) { + if (collection.size === Infinity) { + return 0; + } + const ordered = isOrdered(collection); + const keyed = isKeyed(collection); + let h = ordered ? 1 : 0; + + collection.__iterate( + keyed + ? ordered + ? (v, k) => { + h = (31 * h + hashMerge(hash(v), hash(k))) | 0; + } + : (v, k) => { + h = (h + hashMerge(hash(v), hash(k))) | 0; + } + : ordered + ? (v) => { + h = (31 * h + hash(v)) | 0; + } + : (v) => { + h = (h + hash(v)) | 0; + } + ); + + return murmurHashOfSize(collection.size, h); +} + +function murmurHashOfSize(size, h) { + h = imul(h, 0xcc9e2d51); + h = imul((h << 15) | (h >>> -15), 0x1b873593); + h = imul((h << 13) | (h >>> -13), 5); + h = ((h + 0xe6546b64) | 0) ^ size; + h = imul(h ^ (h >>> 16), 0x85ebca6b); + h = imul(h ^ (h >>> 13), 0xc2b2ae35); + h = smi(h ^ (h >>> 16)); + return h; +} + +function hashMerge(a, b) { + return (a ^ (b + 0x9e3779b9 + (a << 6) + (a >> 2))) | 0; // int +} diff --git a/src/Hash.js b/src/Hash.js index efeacae29e..d1c65f7978 100644 --- a/src/Hash.js +++ b/src/Hash.js @@ -1,60 +1,82 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +import { smi } from './Math'; -import { smi } from './Math' +const defaultValueOf = Object.prototype.valueOf; export function hash(o) { - if (o === false || o === null || o === undefined) { - return 0; + // eslint-disable-next-line eqeqeq + if (o == null) { + return hashNullish(o); } - if (typeof o.valueOf === 'function') { - o = o.valueOf(); - if (o === false || o === null || o === undefined) { - return 0; - } + + if (typeof o.hashCode === 'function') { + // Drop any high bits from accidentally long hash codes. + return smi(o.hashCode(o)); } - if (o === true) { - return 1; + + const v = valueOf(o); + + // eslint-disable-next-line eqeqeq + if (v == null) { + return hashNullish(v); } - var type = typeof o; - if (type === 'number') { - var h = o | 0; - if (h !== o) { - h ^= o * 0xFFFFFFFF; - } - while (o > 0xFFFFFFFF) { - o /= 0xFFFFFFFF; - h ^= o; - } - return smi(h); + + switch (typeof v) { + case 'boolean': + // The hash values for built-in constants are a 1 value for each 5-byte + // shift region expect for the first, which encodes the value. This + // reduces the odds of a hash collision for these common values. + return v ? 0x42108421 : 0x42108420; + case 'number': + return hashNumber(v); + case 'string': + return v.length > STRING_HASH_CACHE_MIN_STRLEN + ? cachedHashString(v) + : hashString(v); + case 'object': + case 'function': + return hashJSObj(v); + case 'symbol': + return hashSymbol(v); + default: + if (typeof v.toString === 'function') { + return hashString(v.toString()); + } + throw new Error('Value type ' + typeof v + ' cannot be hashed.'); + } +} + +function hashNullish(nullish) { + return nullish === null ? 0x42108422 : /* undefined */ 0x42108423; +} + +// Compress arbitrarily large numbers into smi hashes. +function hashNumber(n) { + if (n !== n || n === Infinity) { + return 0; } - if (type === 'string') { - return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o); + let hash = n | 0; + if (hash !== n) { + hash ^= n * 0xffffffff; } - if (typeof o.hashCode === 'function') { - return o.hashCode(); + while (n > 0xffffffff) { + n /= 0xffffffff; + hash ^= n; } - return hashJSObj(o); + return smi(hash); } function cachedHashString(string) { - var hash = stringHashCache[string]; - if (hash === undefined) { - hash = hashString(string); + let hashed = stringHashCache[string]; + if (hashed === undefined) { + hashed = hashString(string); if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) { STRING_HASH_CACHE_SIZE = 0; stringHashCache = {}; } STRING_HASH_CACHE_SIZE++; - stringHashCache[string] = hash; + stringHashCache[string] = hashed; } - return hash; + return hashed; } // http://jsperf.com/hashing-strings @@ -65,90 +87,106 @@ function hashString(string) { // where s[i] is the ith character of the string and n is the length of // the string. We "mod" the result to make it between 0 (inclusive) and 2^31 // (exclusive) by dropping high bits. - var hash = 0; - for (var ii = 0; ii < string.length; ii++) { - hash = 31 * hash + string.charCodeAt(ii) | 0; + let hashed = 0; + for (let ii = 0; ii < string.length; ii++) { + hashed = (31 * hashed + string.charCodeAt(ii)) | 0; } - return smi(hash); + return smi(hashed); +} + +function hashSymbol(sym) { + let hashed = symbolMap[sym]; + if (hashed !== undefined) { + return hashed; + } + + hashed = nextHash(); + + symbolMap[sym] = hashed; + + return hashed; } function hashJSObj(obj) { - var hash; + let hashed; if (usingWeakMap) { - hash = weakMap.get(obj); - if (hash !== undefined) { - return hash; + hashed = weakMap.get(obj); + if (hashed !== undefined) { + return hashed; } } - hash = obj[UID_HASH_KEY]; - if (hash !== undefined) { - return hash; + hashed = obj[UID_HASH_KEY]; + if (hashed !== undefined) { + return hashed; } if (!canDefineProperty) { - hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY]; - if (hash !== undefined) { - return hash; + hashed = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY]; + if (hashed !== undefined) { + return hashed; } - hash = getIENodeHash(obj); - if (hash !== undefined) { - return hash; + hashed = getIENodeHash(obj); + if (hashed !== undefined) { + return hashed; } } - hash = ++objHashUID; - if (objHashUID & 0x40000000) { - objHashUID = 0; - } + hashed = nextHash(); if (usingWeakMap) { - weakMap.set(obj, hash); + weakMap.set(obj, hashed); } else if (isExtensible !== undefined && isExtensible(obj) === false) { throw new Error('Non-extensible objects are not allowed as keys.'); } else if (canDefineProperty) { Object.defineProperty(obj, UID_HASH_KEY, { - 'enumerable': false, - 'configurable': false, - 'writable': false, - 'value': hash + enumerable: false, + configurable: false, + writable: false, + value: hashed, }); - } else if (obj.propertyIsEnumerable !== undefined && - obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) { + } else if ( + obj.propertyIsEnumerable !== undefined && + obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable + ) { // Since we can't define a non-enumerable property on the object // we'll hijack one of the less-used non-enumerable properties to // save our hash on it. Since this is a function it will not show up in // `JSON.stringify` which is what we want. - obj.propertyIsEnumerable = function() { - return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments); + obj.propertyIsEnumerable = function () { + return this.constructor.prototype.propertyIsEnumerable.apply( + this, + arguments + ); }; - obj.propertyIsEnumerable[UID_HASH_KEY] = hash; + obj.propertyIsEnumerable[UID_HASH_KEY] = hashed; } else if (obj.nodeType !== undefined) { // At this point we couldn't get the IE `uniqueID` to use as a hash // and we couldn't use a non-enumerable property to exploit the // dontEnum bug so we simply add the `UID_HASH_KEY` on the node // itself. - obj[UID_HASH_KEY] = hash; + obj[UID_HASH_KEY] = hashed; } else { throw new Error('Unable to set a non-enumerable property on object.'); } - return hash; + return hashed; } // Get references to ES5 object methods. -var isExtensible = Object.isExtensible; +const isExtensible = Object.isExtensible; // True if Object.defineProperty works as expected. IE8 fails this test. -var canDefineProperty = (function() { +const canDefineProperty = (function () { try { Object.defineProperty({}, '@', {}); return true; + // eslint-disable-next-line @typescript-eslint/no-unused-vars } catch (e) { return false; } -}()); +})(); // IE has a `uniqueID` property on DOM nodes. We can construct the hash from it // and avoid memory leaks from the IE cloneNode bug. @@ -163,21 +201,37 @@ function getIENodeHash(node) { } } +function valueOf(obj) { + return obj.valueOf !== defaultValueOf && typeof obj.valueOf === 'function' + ? obj.valueOf(obj) + : obj; +} + +function nextHash() { + const nextHash = ++_objHashUID; + if (_objHashUID & 0x40000000) { + _objHashUID = 0; + } + return nextHash; +} + // If possible, use a WeakMap. -var usingWeakMap = typeof WeakMap === 'function'; -var weakMap; +const usingWeakMap = typeof WeakMap === 'function'; +let weakMap; if (usingWeakMap) { weakMap = new WeakMap(); } -var objHashUID = 0; +const symbolMap = Object.create(null); + +let _objHashUID = 0; -var UID_HASH_KEY = '__immutablehash__'; +let UID_HASH_KEY = '__immutablehash__'; if (typeof Symbol === 'function') { UID_HASH_KEY = Symbol(UID_HASH_KEY); } -var STRING_HASH_CACHE_MIN_STRLEN = 16; -var STRING_HASH_CACHE_MAX_SIZE = 255; -var STRING_HASH_CACHE_SIZE = 0; -var stringHashCache = {}; +const STRING_HASH_CACHE_MIN_STRLEN = 16; +const STRING_HASH_CACHE_MAX_SIZE = 255; +let STRING_HASH_CACHE_SIZE = 0; +let stringHashCache = {}; diff --git a/src/Immutable.js b/src/Immutable.js index fc24ac57fa..98945f762e 100644 --- a/src/Immutable.js +++ b/src/Immutable.js @@ -1,46 +1,103 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +import { Seq } from './Seq'; +import { OrderedMap } from './OrderedMap'; +import { List } from './List'; +import { Map } from './Map'; +import { Stack } from './Stack'; +import { OrderedSet } from './OrderedSet'; +import { PairSorting } from './PairSorting'; +import { Set } from './Set'; +import { Record } from './Record'; +import { Range } from './Range'; +import { Repeat } from './Repeat'; +import { is } from './is'; +import { fromJS } from './fromJS'; -import { Seq } from './Seq' -import { Collection } from './Collection' -import { OrderedMap } from './OrderedMap' -import { List } from './List' -import { Map } from './Map' -import { Stack } from './Stack' -import { OrderedSet } from './OrderedSet' -import { Set } from './Set' -import { Record } from './Record' -import { Range } from './Range' -import { Repeat } from './Repeat' -import { is } from './is' -import { fromJS } from './fromJS' -import { Iterable } from './IterableImpl' +import isPlainObject from './utils/isPlainObj'; +// Functional predicates +import { isImmutable } from './predicates/isImmutable'; +import { isCollection } from './predicates/isCollection'; +import { isKeyed } from './predicates/isKeyed'; +import { isIndexed } from './predicates/isIndexed'; +import { isAssociative } from './predicates/isAssociative'; +import { isOrdered } from './predicates/isOrdered'; +import { isValueObject } from './predicates/isValueObject'; +import { isSeq } from './predicates/isSeq'; +import { isList } from './predicates/isList'; +import { isMap } from './predicates/isMap'; +import { isOrderedMap } from './predicates/isOrderedMap'; +import { isStack } from './predicates/isStack'; +import { isSet } from './predicates/isSet'; +import { isOrderedSet } from './predicates/isOrderedSet'; +import { isRecord } from './predicates/isRecord'; -export default { +import { Collection } from './CollectionImpl'; +import { hash } from './Hash'; - Iterable: Iterable, +// Functional read/write API +import { get } from './functional/get'; +import { getIn } from './functional/getIn'; +import { has } from './functional/has'; +import { hasIn } from './functional/hasIn'; +import { merge, mergeDeep, mergeWith, mergeDeepWith } from './functional/merge'; +import { remove } from './functional/remove'; +import { removeIn } from './functional/removeIn'; +import { set } from './functional/set'; +import { setIn } from './functional/setIn'; +import { update } from './functional/update'; +import { updateIn } from './functional/updateIn'; - Seq: Seq, - Collection: Collection, - Map: Map, - OrderedMap: OrderedMap, - List: List, - Stack: Stack, - Set: Set, - OrderedSet: OrderedSet, +import { version } from '../package.json'; - Record: Record, - Range: Range, - Repeat: Repeat, - - is: is, - fromJS: fromJS, +// Note: Iterable is deprecated +const Iterable = Collection; +export { + version, + Collection, + Iterable, + Seq, + Map, + OrderedMap, + List, + Stack, + Set, + OrderedSet, + PairSorting, + Record, + Range, + Repeat, + is, + fromJS, + hash, + isImmutable, + isCollection, + isKeyed, + isIndexed, + isAssociative, + isOrdered, + isPlainObject, + isValueObject, + isSeq, + isList, + isMap, + isOrderedMap, + isStack, + isSet, + isOrderedSet, + isRecord, + get, + getIn, + has, + hasIn, + merge, + mergeDeep, + mergeWith, + mergeDeepWith, + remove, + removeIn, + set, + setIn, + update, + updateIn, }; diff --git a/src/Iterable.js b/src/Iterable.js deleted file mode 100644 index f856a03e41..0000000000 --- a/src/Iterable.js +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { Seq, KeyedSeq, IndexedSeq, SetSeq } from './Seq' - - -export class Iterable { - constructor(value) { - return isIterable(value) ? value : Seq(value); - } -} - -export class KeyedIterable extends Iterable { - constructor(value) { - return isKeyed(value) ? value : KeyedSeq(value); - } -} - -export class IndexedIterable extends Iterable { - constructor(value) { - return isIndexed(value) ? value : IndexedSeq(value); - } -} - -export class SetIterable extends Iterable { - constructor(value) { - return isIterable(value) && !isAssociative(value) ? value : SetSeq(value); - } -} - - -export function isIterable(maybeIterable) { - return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]); -} - -export function isKeyed(maybeKeyed) { - return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]); -} - -export function isIndexed(maybeIndexed) { - return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]); -} - -export function isAssociative(maybeAssociative) { - return isKeyed(maybeAssociative) || isIndexed(maybeAssociative); -} - -export function isOrdered(maybeOrdered) { - return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]); -} - -Iterable.isIterable = isIterable; -Iterable.isKeyed = isKeyed; -Iterable.isIndexed = isIndexed; -Iterable.isAssociative = isAssociative; -Iterable.isOrdered = isOrdered; - -Iterable.Keyed = KeyedIterable; -Iterable.Indexed = IndexedIterable; -Iterable.Set = SetIterable; - - -export var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; -export var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@'; -export var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@'; -export var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; diff --git a/src/IterableImpl.js b/src/IterableImpl.js deleted file mode 100644 index 8843aeed70..0000000000 --- a/src/IterableImpl.js +++ /dev/null @@ -1,770 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { Iterable, KeyedIterable, IndexedIterable, SetIterable, - isIterable, isKeyed, isIndexed, isAssociative, isOrdered, - IS_ITERABLE_SENTINEL, IS_KEYED_SENTINEL, IS_INDEXED_SENTINEL, IS_ORDERED_SENTINEL } from './Iterable' - -import { is } from './is' -import { arrCopy, NOT_SET, ensureSize, wrapIndex, - returnTrue, resolveBegin } from './TrieUtils' -import { hash } from './Hash' -import { imul, smi } from './Math' -import { Iterator, - ITERATOR_SYMBOL, ITERATE_KEYS, ITERATE_VALUES, ITERATE_ENTRIES } from './Iterator' - -import assertNotInfinite from './utils/assertNotInfinite' -import forceIterator from './utils/forceIterator' -import deepEqual from './utils/deepEqual' -import mixin from './utils/mixin' - -import { Map } from './Map' -import { OrderedMap } from './OrderedMap' -import { List } from './List' -import { Set } from './Set' -import { OrderedSet } from './OrderedSet' -import { Stack } from './Stack' -import { KeyedSeq, IndexedSeq, SetSeq, ArraySeq } from './Seq' -import { KeyedCollection, IndexedCollection, SetCollection } from './Collection' -import { reify, ToKeyedSequence, ToIndexedSequence, ToSetSequence, - FromEntriesSequence, flipFactory, mapFactory, reverseFactory, - filterFactory, countByFactory, groupByFactory, sliceFactory, - takeWhileFactory, skipWhileFactory, concatFactory, - flattenFactory, flatMapFactory, interposeFactory, sortFactory, - maxFactory, zipWithFactory } from './Operations' - -export { Iterable, KeyedIterable, IndexedIterable, SetIterable, - isIterable, isKeyed, isIndexed, isAssociative, isOrdered, IS_ORDERED_SENTINEL } - - -Iterable.Iterator = Iterator; - -mixin(Iterable, { - - // ### Conversion to other types - - toArray() { - assertNotInfinite(this.size); - var array = new Array(this.size || 0); - this.valueSeq().__iterate((v, i) => { array[i] = v; }); - return array; - }, - - toIndexedSeq() { - return new ToIndexedSequence(this); - }, - - toJS() { - return this.toSeq().map( - value => value && typeof value.toJS === 'function' ? value.toJS() : value - ).__toJS(); - }, - - toJSON() { - return this.toSeq().map( - value => value && typeof value.toJSON === 'function' ? value.toJSON() : value - ).__toJS(); - }, - - toKeyedSeq() { - return new ToKeyedSequence(this, true); - }, - - toMap() { - // Use Late Binding here to solve the circular dependency. - return Map(this.toKeyedSeq()); - }, - - toObject() { - assertNotInfinite(this.size); - var object = {}; - this.__iterate((v, k) => { object[k] = v; }); - return object; - }, - - toOrderedMap() { - // Use Late Binding here to solve the circular dependency. - return OrderedMap(this.toKeyedSeq()); - }, - - toOrderedSet() { - // Use Late Binding here to solve the circular dependency. - return OrderedSet(isKeyed(this) ? this.valueSeq() : this); - }, - - toSet() { - // Use Late Binding here to solve the circular dependency. - return Set(isKeyed(this) ? this.valueSeq() : this); - }, - - toSetSeq() { - return new ToSetSequence(this); - }, - - toSeq() { - return isIndexed(this) ? this.toIndexedSeq() : - isKeyed(this) ? this.toKeyedSeq() : - this.toSetSeq(); - }, - - toStack() { - // Use Late Binding here to solve the circular dependency. - return Stack(isKeyed(this) ? this.valueSeq() : this); - }, - - toList() { - // Use Late Binding here to solve the circular dependency. - return List(isKeyed(this) ? this.valueSeq() : this); - }, - - - // ### Common JavaScript methods and properties - - toString() { - return '[Iterable]'; - }, - - __toString(head, tail) { - if (this.size === 0) { - return head + tail; - } - return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail; - }, - - - // ### ES6 Collection methods (ES6 Array and Map) - - concat(...values) { - return reify(this, concatFactory(this, values)); - }, - - contains(searchValue) { - return this.includes(searchValue); - }, - - includes(searchValue) { - return this.some(value => is(value, searchValue)); - }, - - entries() { - return this.__iterator(ITERATE_ENTRIES); - }, - - every(predicate, context) { - assertNotInfinite(this.size); - var returnValue = true; - this.__iterate((v, k, c) => { - if (!predicate.call(context, v, k, c)) { - returnValue = false; - return false; - } - }); - return returnValue; - }, - - filter(predicate, context) { - return reify(this, filterFactory(this, predicate, context, true)); - }, - - find(predicate, context, notSetValue) { - var entry = this.findEntry(predicate, context); - return entry ? entry[1] : notSetValue; - }, - - findEntry(predicate, context) { - var found; - this.__iterate((v, k, c) => { - if (predicate.call(context, v, k, c)) { - found = [k, v]; - return false; - } - }); - return found; - }, - - findLastEntry(predicate, context) { - return this.toSeq().reverse().findEntry(predicate, context); - }, - - forEach(sideEffect, context) { - assertNotInfinite(this.size); - return this.__iterate(context ? sideEffect.bind(context) : sideEffect); - }, - - join(separator) { - assertNotInfinite(this.size); - separator = separator !== undefined ? '' + separator : ','; - var joined = ''; - var isFirst = true; - this.__iterate(v => { - isFirst ? (isFirst = false) : (joined += separator); - joined += v !== null && v !== undefined ? v.toString() : ''; - }); - return joined; - }, - - keys() { - return this.__iterator(ITERATE_KEYS); - }, - - map(mapper, context) { - return reify(this, mapFactory(this, mapper, context)); - }, - - reduce(reducer, initialReduction, context) { - assertNotInfinite(this.size); - var reduction; - var useFirst; - if (arguments.length < 2) { - useFirst = true; - } else { - reduction = initialReduction; - } - this.__iterate((v, k, c) => { - if (useFirst) { - useFirst = false; - reduction = v; - } else { - reduction = reducer.call(context, reduction, v, k, c); - } - }); - return reduction; - }, - - reduceRight(reducer, initialReduction, context) { - var reversed = this.toKeyedSeq().reverse(); - return reversed.reduce.apply(reversed, arguments); - }, - - reverse() { - return reify(this, reverseFactory(this, true)); - }, - - slice(begin, end) { - return reify(this, sliceFactory(this, begin, end, true)); - }, - - some(predicate, context) { - return !this.every(not(predicate), context); - }, - - sort(comparator) { - return reify(this, sortFactory(this, comparator)); - }, - - values() { - return this.__iterator(ITERATE_VALUES); - }, - - - // ### More sequential methods - - butLast() { - return this.slice(0, -1); - }, - - isEmpty() { - return this.size !== undefined ? this.size === 0 : !this.some(() => true); - }, - - count(predicate, context) { - return ensureSize( - predicate ? this.toSeq().filter(predicate, context) : this - ); - }, - - countBy(grouper, context) { - return countByFactory(this, grouper, context); - }, - - equals(other) { - return deepEqual(this, other); - }, - - entrySeq() { - var iterable = this; - if (iterable._cache) { - // We cache as an entries array, so we can just return the cache! - return new ArraySeq(iterable._cache); - } - var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq(); - entriesSequence.fromEntrySeq = () => iterable.toSeq(); - return entriesSequence; - }, - - filterNot(predicate, context) { - return this.filter(not(predicate), context); - }, - - findLast(predicate, context, notSetValue) { - return this.toKeyedSeq().reverse().find(predicate, context, notSetValue); - }, - - first() { - return this.find(returnTrue); - }, - - flatMap(mapper, context) { - return reify(this, flatMapFactory(this, mapper, context)); - }, - - flatten(depth) { - return reify(this, flattenFactory(this, depth, true)); - }, - - fromEntrySeq() { - return new FromEntriesSequence(this); - }, - - get(searchKey, notSetValue) { - return this.find((_, key) => is(key, searchKey), undefined, notSetValue); - }, - - getIn(searchKeyPath, notSetValue) { - var nested = this; - // Note: in an ES6 environment, we would prefer: - // for (var key of searchKeyPath) { - var iter = forceIterator(searchKeyPath); - var step; - while (!(step = iter.next()).done) { - var key = step.value; - nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET; - if (nested === NOT_SET) { - return notSetValue; - } - } - return nested; - }, - - groupBy(grouper, context) { - return groupByFactory(this, grouper, context); - }, - - has(searchKey) { - return this.get(searchKey, NOT_SET) !== NOT_SET; - }, - - hasIn(searchKeyPath) { - return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET; - }, - - isSubset(iter) { - iter = typeof iter.includes === 'function' ? iter : Iterable(iter); - return this.every(value => iter.includes(value)); - }, - - isSuperset(iter) { - return iter.isSubset(this); - }, - - keySeq() { - return this.toSeq().map(keyMapper).toIndexedSeq(); - }, - - last() { - return this.toSeq().reverse().first(); - }, - - max(comparator) { - return maxFactory(this, comparator); - }, - - maxBy(mapper, comparator) { - return maxFactory(this, comparator, mapper); - }, - - min(comparator) { - return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator); - }, - - minBy(mapper, comparator) { - return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper); - }, - - rest() { - return this.slice(1); - }, - - skip(amount) { - return this.slice(Math.max(0, amount)); - }, - - skipLast(amount) { - return reify(this, this.toSeq().reverse().skip(amount).reverse()); - }, - - skipWhile(predicate, context) { - return reify(this, skipWhileFactory(this, predicate, context, true)); - }, - - skipUntil(predicate, context) { - return this.skipWhile(not(predicate), context); - }, - - sortBy(mapper, comparator) { - return reify(this, sortFactory(this, comparator, mapper)); - }, - - take(amount) { - return this.slice(0, Math.max(0, amount)); - }, - - takeLast(amount) { - return reify(this, this.toSeq().reverse().take(amount).reverse()); - }, - - takeWhile(predicate, context) { - return reify(this, takeWhileFactory(this, predicate, context)); - }, - - takeUntil(predicate, context) { - return this.takeWhile(not(predicate), context); - }, - - valueSeq() { - return this.toIndexedSeq(); - }, - - - // ### Hashable Object - - hashCode() { - return this.__hash || (this.__hash = hashIterable(this)); - }, - - - // ### Internal - - // abstract __iterate(fn, reverse) - - // abstract __iterator(type, reverse) -}); - -// var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@'; -// var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@'; -// var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@'; -// var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@'; - -var IterablePrototype = Iterable.prototype; -IterablePrototype[IS_ITERABLE_SENTINEL] = true; -IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values; -IterablePrototype.__toJS = IterablePrototype.toArray; -IterablePrototype.__toStringMapper = quoteString; -IterablePrototype.inspect = -IterablePrototype.toSource = function() { return this.toString(); }; -IterablePrototype.chain = IterablePrototype.flatMap; - -// Temporary warning about using length -(function () { - try { - Object.defineProperty(IterablePrototype, 'length', { - get: function () { - if (!Iterable.noLengthWarning) { - var stack; - try { - throw new Error(); - } catch (error) { - stack = error.stack; - } - if (stack.indexOf('_wrapObject') === -1) { - console && console.warn && console.warn( - 'iterable.length has been deprecated, '+ - 'use iterable.size or iterable.count(). '+ - 'This warning will become a silent error in a future version. ' + - stack - ); - return this.size; - } - } - } - }); - } catch (e) {} -})(); - - - -mixin(KeyedIterable, { - - // ### More sequential methods - - flip() { - return reify(this, flipFactory(this)); - }, - - findKey(predicate, context) { - var entry = this.findEntry(predicate, context); - return entry && entry[0]; - }, - - findLastKey(predicate, context) { - return this.toSeq().reverse().findKey(predicate, context); - }, - - keyOf(searchValue) { - return this.findKey(value => is(value, searchValue)); - }, - - lastKeyOf(searchValue) { - return this.findLastKey(value => is(value, searchValue)); - }, - - mapEntries(mapper, context) { - var iterations = 0; - return reify(this, - this.toSeq().map( - (v, k) => mapper.call(context, [k, v], iterations++, this) - ).fromEntrySeq() - ); - }, - - mapKeys(mapper, context) { - return reify(this, - this.toSeq().flip().map( - (k, v) => mapper.call(context, k, v, this) - ).flip() - ); - }, - -}); - -var KeyedIterablePrototype = KeyedIterable.prototype; -KeyedIterablePrototype[IS_KEYED_SENTINEL] = true; -KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries; -KeyedIterablePrototype.__toJS = IterablePrototype.toObject; -KeyedIterablePrototype.__toStringMapper = (v, k) => JSON.stringify(k) + ': ' + quoteString(v); - - - -mixin(IndexedIterable, { - - // ### Conversion to other types - - toKeyedSeq() { - return new ToKeyedSequence(this, false); - }, - - - // ### ES6 Collection methods (ES6 Array and Map) - - filter(predicate, context) { - return reify(this, filterFactory(this, predicate, context, false)); - }, - - findIndex(predicate, context) { - var entry = this.findEntry(predicate, context); - return entry ? entry[0] : -1; - }, - - indexOf(searchValue) { - var key = this.toKeyedSeq().keyOf(searchValue); - return key === undefined ? -1 : key; - }, - - lastIndexOf(searchValue) { - return this.toSeq().reverse().indexOf(searchValue); - }, - - reverse() { - return reify(this, reverseFactory(this, false)); - }, - - slice(begin, end) { - return reify(this, sliceFactory(this, begin, end, false)); - }, - - splice(index, removeNum /*, ...values*/) { - var numArgs = arguments.length; - removeNum = Math.max(removeNum | 0, 0); - if (numArgs === 0 || (numArgs === 2 && !removeNum)) { - return this; - } - index = resolveBegin(index, this.size); - var spliced = this.slice(0, index); - return reify( - this, - numArgs === 1 ? - spliced : - spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)) - ); - }, - - - // ### More collection methods - - findLastIndex(predicate, context) { - var key = this.toKeyedSeq().findLastKey(predicate, context); - return key === undefined ? -1 : key; - }, - - first() { - return this.get(0); - }, - - flatten(depth) { - return reify(this, flattenFactory(this, depth, false)); - }, - - get(index, notSetValue) { - index = wrapIndex(this, index); - return (index < 0 || (this.size === Infinity || - (this.size !== undefined && index > this.size))) ? - notSetValue : - this.find((_, key) => key === index, undefined, notSetValue); - }, - - has(index) { - index = wrapIndex(this, index); - return index >= 0 && (this.size !== undefined ? - this.size === Infinity || index < this.size : - this.indexOf(index) !== -1 - ); - }, - - interpose(separator) { - return reify(this, interposeFactory(this, separator)); - }, - - interleave(/*...iterables*/) { - var iterables = [this].concat(arrCopy(arguments)); - var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables); - var interleaved = zipped.flatten(true); - if (zipped.size) { - interleaved.size = zipped.size * iterables.length; - } - return reify(this, interleaved); - }, - - last() { - return this.get(-1); - }, - - skipWhile(predicate, context) { - return reify(this, skipWhileFactory(this, predicate, context, false)); - }, - - zip(/*, ...iterables */) { - var iterables = [this].concat(arrCopy(arguments)); - return reify(this, zipWithFactory(this, defaultZipper, iterables)); - }, - - zipWith(zipper/*, ...iterables */) { - var iterables = arrCopy(arguments); - iterables[0] = this; - return reify(this, zipWithFactory(this, zipper, iterables)); - }, - -}); - -IndexedIterable.prototype[IS_INDEXED_SENTINEL] = true; -IndexedIterable.prototype[IS_ORDERED_SENTINEL] = true; - - - -mixin(SetIterable, { - - // ### ES6 Collection methods (ES6 Array and Map) - - get(value, notSetValue) { - return this.has(value) ? value : notSetValue; - }, - - includes(value) { - return this.has(value); - }, - - - // ### More sequential methods - - keySeq() { - return this.valueSeq(); - }, - -}); - -SetIterable.prototype.has = IterablePrototype.includes; - - -// Mixin subclasses - -mixin(KeyedSeq, KeyedIterable.prototype); -mixin(IndexedSeq, IndexedIterable.prototype); -mixin(SetSeq, SetIterable.prototype); - -mixin(KeyedCollection, KeyedIterable.prototype); -mixin(IndexedCollection, IndexedIterable.prototype); -mixin(SetCollection, SetIterable.prototype); - - -// #pragma Helper functions - -function keyMapper(v, k) { - return k; -} - -function entryMapper(v, k) { - return [k, v]; -} - -function not(predicate) { - return function() { - return !predicate.apply(this, arguments); - } -} - -function neg(predicate) { - return function() { - return -predicate.apply(this, arguments); - } -} - -function quoteString(value) { - return typeof value === 'string' ? JSON.stringify(value) : value; -} - -function defaultZipper() { - return arrCopy(arguments); -} - -function defaultNegComparator(a, b) { - return a < b ? 1 : a > b ? -1 : 0; -} - -function hashIterable(iterable) { - if (iterable.size === Infinity) { - return 0; - } - var ordered = isOrdered(iterable); - var keyed = isKeyed(iterable); - var h = ordered ? 1 : 0; - var size = iterable.__iterate( - keyed ? - ordered ? - (v, k) => { h = 31 * h + hashMerge(hash(v), hash(k)) | 0; } : - (v, k) => { h = h + hashMerge(hash(v), hash(k)) | 0; } : - ordered ? - v => { h = 31 * h + hash(v) | 0; } : - v => { h = h + hash(v) | 0; } - ); - return murmurHashOfSize(size, h); -} - -function murmurHashOfSize(size, h) { - h = imul(h, 0xCC9E2D51); - h = imul(h << 15 | h >>> -15, 0x1B873593); - h = imul(h << 13 | h >>> -13, 5); - h = (h + 0xE6546B64 | 0) ^ size; - h = imul(h ^ h >>> 16, 0x85EBCA6B); - h = imul(h ^ h >>> 13, 0xC2B2AE35); - h = smi(h ^ h >>> 16); - return h; -} - -function hashMerge(a, b) { - return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0; // int -} diff --git a/src/Iterator.js b/src/Iterator.js index bc1614716e..1954a3661c 100644 --- a/src/Iterator.js +++ b/src/Iterator.js @@ -1,23 +1,11 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +export const ITERATE_KEYS = 0; +export const ITERATE_VALUES = 1; +export const ITERATE_ENTRIES = 2; -/* global Symbol */ - -export var ITERATE_KEYS = 0; -export var ITERATE_VALUES = 1; -export var ITERATE_ENTRIES = 2; - -var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; -var FAUX_ITERATOR_SYMBOL = '@@iterator'; - -export var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL; +const REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; +const FAUX_ITERATOR_SYMBOL = '@@iterator'; +export const ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL; export class Iterator { constructor(next) { @@ -33,18 +21,23 @@ Iterator.KEYS = ITERATE_KEYS; Iterator.VALUES = ITERATE_VALUES; Iterator.ENTRIES = ITERATE_ENTRIES; -Iterator.prototype.inspect = -Iterator.prototype.toSource = function () { return this.toString(); } +Iterator.prototype.inspect = Iterator.prototype.toSource = function () { + return this.toString(); +}; Iterator.prototype[ITERATOR_SYMBOL] = function () { return this; }; - export function iteratorValue(type, k, v, iteratorResult) { - var value = type === 0 ? k : type === 1 ? v : [k, v]; - iteratorResult ? (iteratorResult.value = value) : (iteratorResult = { - value: value, done: false - }); + const value = + type === ITERATE_KEYS ? k : type === ITERATE_VALUES ? v : [k, v]; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + iteratorResult + ? (iteratorResult.value = value) + : (iteratorResult = { + value: value, + done: false, + }); return iteratorResult; } @@ -53,6 +46,11 @@ export function iteratorDone() { } export function hasIterator(maybeIterable) { + if (Array.isArray(maybeIterable)) { + // IE11 trick as it does not support `Symbol.iterator` + return true; + } + return !!getIteratorFn(maybeIterable); } @@ -61,16 +59,26 @@ export function isIterator(maybeIterator) { } export function getIterator(iterable) { - var iteratorFn = getIteratorFn(iterable); + const iteratorFn = getIteratorFn(iterable); return iteratorFn && iteratorFn.call(iterable); } function getIteratorFn(iterable) { - var iteratorFn = iterable && ( - (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) || - iterable[FAUX_ITERATOR_SYMBOL] - ); + const iteratorFn = + iterable && + ((REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) || + iterable[FAUX_ITERATOR_SYMBOL]); if (typeof iteratorFn === 'function') { return iteratorFn; } } + +export function isEntriesIterable(maybeIterable) { + const iteratorFn = getIteratorFn(maybeIterable); + return iteratorFn && iteratorFn === maybeIterable.entries; +} + +export function isKeysIterable(maybeIterable) { + const iteratorFn = getIteratorFn(maybeIterable); + return iteratorFn && iteratorFn === maybeIterable.keys; +} diff --git a/src/List.js b/src/List.js index 008d1c8f6e..966b9e1b2c 100644 --- a/src/List.js +++ b/src/List.js @@ -1,45 +1,57 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { fromJS } from './fromJS' -import { DELETE, SHIFT, SIZE, MASK, DID_ALTER, OwnerID, MakeRef, - SetRef, wrapIndex, wholeSlice, resolveBegin, resolveEnd } from './TrieUtils' -import { isIterable, IndexedIterable } from './Iterable' -import { IndexedCollection } from './Collection' -import { MapPrototype, mergeIntoCollectionWith, deepMerger } from './Map' -import { Iterator, iteratorValue, iteratorDone } from './Iterator' - -import assertNotInfinite from './utils/assertNotInfinite' - +import { + DELETE, + SHIFT, + SIZE, + MASK, + OwnerID, + MakeRef, + SetRef, + wrapIndex, + wholeSlice, + resolveBegin, + resolveEnd, +} from './TrieUtils'; +import { IS_LIST_SYMBOL, isList } from './predicates/isList'; +import { IndexedCollection } from './Collection'; +import { hasIterator, Iterator, iteratorValue, iteratorDone } from './Iterator'; +import { setIn } from './methods/setIn'; +import { deleteIn } from './methods/deleteIn'; +import { update } from './methods/update'; +import { updateIn } from './methods/updateIn'; +import { mergeIn } from './methods/mergeIn'; +import { mergeDeepIn } from './methods/mergeDeepIn'; +import { withMutations } from './methods/withMutations'; +import { asMutable } from './methods/asMutable'; +import { asImmutable } from './methods/asImmutable'; +import { wasAltered } from './methods/wasAltered'; +import assertNotInfinite from './utils/assertNotInfinite'; export class List extends IndexedCollection { - // @pragma Construction constructor(value) { - var empty = emptyList(); - if (value === null || value === undefined) { + const empty = emptyList(); + if (value === undefined || value === null) { + // eslint-disable-next-line no-constructor-return return empty; } if (isList(value)) { + // eslint-disable-next-line no-constructor-return return value; } - var iter = IndexedIterable(value); - var size = iter.size; + const iter = IndexedCollection(value); + const size = iter.size; if (size === 0) { + // eslint-disable-next-line no-constructor-return return empty; } assertNotInfinite(size); if (size > 0 && size < SIZE) { + // eslint-disable-next-line no-constructor-return return makeList(0, size, SHIFT, null, new VNode(iter.toArray())); } - return empty.withMutations(list => { + // eslint-disable-next-line no-constructor-return + return empty.withMutations((list) => { list.setSize(size); iter.forEach((v, i) => list.set(i, v)); }); @@ -57,12 +69,12 @@ export class List extends IndexedCollection { get(index, notSetValue) { index = wrapIndex(this, index); - if (index < 0 || index >= this.size) { - return notSetValue; + if (index >= 0 && index < this.size) { + index += this._origin; + const node = listNodeFor(this, index); + return node && node.array[index & MASK]; } - index += this._origin; - var node = listNodeFor(this, index); - return node && node.array[index & MASK]; + return notSetValue; } // @pragma Modification @@ -72,10 +84,17 @@ export class List extends IndexedCollection { } remove(index) { - return !this.has(index) ? this : - index === 0 ? this.shift() : - index === this.size - 1 ? this.pop() : - this.splice(index, 1); + return !this.has(index) + ? this + : index === 0 + ? this.shift() + : index === this.size - 1 + ? this.pop() + : this.splice(index, 1); + } + + insert(index, value) { + return this.splice(index, 0, value); } clear() { @@ -85,8 +104,7 @@ export class List extends IndexedCollection { if (this.__ownerID) { this.size = this._origin = this._capacity = 0; this._level = SHIFT; - this._root = this._tail = null; - this.__hash = undefined; + this._root = this._tail = this.__hash = undefined; this.__altered = true; return this; } @@ -94,11 +112,11 @@ export class List extends IndexedCollection { } push(/*...values*/) { - var values = arguments; - var oldSize = this.size; - return this.withMutations(list => { + const values = arguments; + const oldSize = this.size; + return this.withMutations((list) => { setListBounds(list, 0, oldSize + values.length); - for (var ii = 0; ii < values.length; ii++) { + for (let ii = 0; ii < values.length; ii++) { list.set(oldSize + ii, values[ii]); } }); @@ -109,10 +127,10 @@ export class List extends IndexedCollection { } unshift(/*...values*/) { - var values = arguments; - return this.withMutations(list => { + const values = arguments; + return this.withMutations((list) => { setListBounds(list, -values.length); - for (var ii = 0; ii < values.length; ii++) { + for (let ii = 0; ii < values.length; ii++) { list.set(ii, values[ii]); } }); @@ -122,32 +140,65 @@ export class List extends IndexedCollection { return setListBounds(this, 1); } - // @pragma Composition + shuffle(random = Math.random) { + return this.withMutations((mutable) => { + // implementation of the Fisher-Yates shuffle: https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle + let current = mutable.size; + let destination; + let tmp; - merge(/*...iters*/) { - return mergeIntoListWith(this, undefined, arguments); - } + while (current) { + destination = Math.floor(random() * current--); - mergeWith(merger, ...iters) { - return mergeIntoListWith(this, merger, iters); + tmp = mutable.get(destination); + mutable.set(destination, mutable.get(current)); + mutable.set(current, tmp); + } + }); } - mergeDeep(/*...iters*/) { - return mergeIntoListWith(this, deepMerger(undefined), arguments); - } + // @pragma Composition - mergeDeepWith(merger, ...iters) { - return mergeIntoListWith(this, deepMerger(merger), iters); + concat(/*...collections*/) { + const seqs = []; + for (let i = 0; i < arguments.length; i++) { + const argument = arguments[i]; + const seq = IndexedCollection( + typeof argument !== 'string' && hasIterator(argument) + ? argument + : [argument] + ); + if (seq.size !== 0) { + seqs.push(seq); + } + } + if (seqs.length === 0) { + return this; + } + if (this.size === 0 && !this.__ownerID && seqs.length === 1) { + return this.constructor(seqs[0]); + } + return this.withMutations((list) => { + seqs.forEach((seq) => seq.forEach((value) => list.push(value))); + }); } setSize(size) { return setListBounds(this, 0, size); } + map(mapper, context) { + return this.withMutations((list) => { + for (let i = 0; i < this.size; i++) { + list.set(i, mapper.call(context, list.get(i), i, this)); + } + }); + } + // @pragma Iteration slice(begin, end) { - var size = this.size; + const size = this.size; if (wholeSlice(begin, end, size)) { return this; } @@ -159,22 +210,22 @@ export class List extends IndexedCollection { } __iterator(type, reverse) { - var index = 0; - var values = iterateList(this, reverse); + let index = reverse ? this.size : 0; + const values = iterateList(this, reverse); return new Iterator(() => { - var value = values(); - return value === DONE ? - iteratorDone() : - iteratorValue(type, index++, value); + const value = values(); + return value === DONE + ? iteratorDone() + : iteratorValue(type, reverse ? --index : index++, value); }); } __iterate(fn, reverse) { - var index = 0; - var values = iterateList(this, reverse); - var value; + let index = reverse ? this.size : 0; + const values = iterateList(this, reverse); + let value; while ((value = values()) !== DONE) { - if (fn(value, index++, this) === false) { + if (fn(value, reverse ? --index : index++, this) === false) { break; } } @@ -186,36 +237,47 @@ export class List extends IndexedCollection { return this; } if (!ownerID) { + if (this.size === 0) { + return emptyList(); + } this.__ownerID = ownerID; + this.__altered = false; return this; } - return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash); + return makeList( + this._origin, + this._capacity, + this._level, + this._root, + this._tail, + ownerID, + this.__hash + ); } } -export function isList(maybeList) { - return !!(maybeList && maybeList[IS_LIST_SENTINEL]); -} - List.isList = isList; -var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@'; - -export var ListPrototype = List.prototype; -ListPrototype[IS_LIST_SENTINEL] = true; +const ListPrototype = List.prototype; +ListPrototype[IS_LIST_SYMBOL] = true; ListPrototype[DELETE] = ListPrototype.remove; -ListPrototype.setIn = MapPrototype.setIn; -ListPrototype.deleteIn = -ListPrototype.removeIn = MapPrototype.removeIn; -ListPrototype.update = MapPrototype.update; -ListPrototype.updateIn = MapPrototype.updateIn; -ListPrototype.mergeIn = MapPrototype.mergeIn; -ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn; -ListPrototype.withMutations = MapPrototype.withMutations; -ListPrototype.asMutable = MapPrototype.asMutable; -ListPrototype.asImmutable = MapPrototype.asImmutable; -ListPrototype.wasAltered = MapPrototype.wasAltered; - +ListPrototype.merge = ListPrototype.concat; +ListPrototype.setIn = setIn; +ListPrototype.deleteIn = ListPrototype.removeIn = deleteIn; +ListPrototype.update = update; +ListPrototype.updateIn = updateIn; +ListPrototype.mergeIn = mergeIn; +ListPrototype.mergeDeepIn = mergeDeepIn; +ListPrototype.withMutations = withMutations; +ListPrototype.wasAltered = wasAltered; +ListPrototype.asImmutable = asImmutable; +ListPrototype['@@transducer/init'] = ListPrototype.asMutable = asMutable; +ListPrototype['@@transducer/step'] = function (result, arr) { + return result.push(arr); +}; +ListPrototype['@@transducer/result'] = function (obj) { + return obj.asImmutable(); +}; class VNode { constructor(array, ownerID) { @@ -226,18 +288,22 @@ class VNode { // TODO: seems like these methods are very similar removeBefore(ownerID, level, index) { - if (index === level ? 1 << level : 0 || this.array.length === 0) { + if ( + (index & ((1 << (level + SHIFT)) - 1)) === 0 || + this.array.length === 0 + ) { return this; } - var originIndex = (index >>> level) & MASK; + const originIndex = (index >>> level) & MASK; if (originIndex >= this.array.length) { return new VNode([], ownerID); } - var removingFirst = originIndex === 0; - var newChild; + const removingFirst = originIndex === 0; + let newChild; if (level > 0) { - var oldChild = this.array[originIndex]; - newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index); + const oldChild = this.array[originIndex]; + newChild = + oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index); if (newChild === oldChild && removingFirst) { return this; } @@ -245,9 +311,9 @@ class VNode { if (removingFirst && !newChild) { return this; } - var editable = editableVNode(this, ownerID); + const editable = editableVNode(this, ownerID); if (!removingFirst) { - for (var ii = 0; ii < originIndex; ii++) { + for (let ii = 0; ii < originIndex; ii++) { editable.array[ii] = undefined; } } @@ -258,29 +324,29 @@ class VNode { } removeAfter(ownerID, level, index) { - if (index === level ? 1 << level : 0 || this.array.length === 0) { + if ( + index === (level ? 1 << (level + SHIFT) : SIZE) || + this.array.length === 0 + ) { return this; } - var sizeIndex = ((index - 1) >>> level) & MASK; + const sizeIndex = ((index - 1) >>> level) & MASK; if (sizeIndex >= this.array.length) { return this; } - var removingLast = sizeIndex === this.array.length - 1; - var newChild; + + let newChild; if (level > 0) { - var oldChild = this.array[sizeIndex]; - newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index); - if (newChild === oldChild && removingLast) { + const oldChild = this.array[sizeIndex]; + newChild = + oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index); + if (newChild === oldChild && sizeIndex === this.array.length - 1) { return this; } } - if (removingLast && !newChild) { - return this; - } - var editable = editableVNode(this, ownerID); - if (!removingLast) { - editable.array.pop(); - } + + const editable = editableVNode(this, ownerID); + editable.array.splice(sizeIndex + 1); if (newChild) { editable.array[sizeIndex] = newChild; } @@ -288,27 +354,26 @@ class VNode { } } - -var DONE = {}; +const DONE = {}; function iterateList(list, reverse) { - var left = list._origin; - var right = list._capacity; - var tailPos = getTailOffset(right); - var tail = list._tail; + const left = list._origin; + const right = list._capacity; + const tailPos = getTailOffset(right); + const tail = list._tail; return iterateNodeOrLeaf(list._root, list._level, 0); function iterateNodeOrLeaf(node, level, offset) { - return level === 0 ? - iterateLeaf(node, offset) : - iterateNode(node, level, offset); + return level === 0 + ? iterateLeaf(node, offset) + : iterateNode(node, level, offset); } function iterateLeaf(node, offset) { - var array = offset === tailPos ? tail && tail.array : node && node.array; - var from = offset > left ? 0 : left - offset; - var to = right - offset; + const array = offset === tailPos ? tail && tail.array : node && node.array; + let from = offset > left ? 0 : left - offset; + let to = right - offset; if (to > SIZE) { to = SIZE; } @@ -316,23 +381,23 @@ function iterateList(list, reverse) { if (from === to) { return DONE; } - var idx = reverse ? --to : from++; + const idx = reverse ? --to : from++; return array && array[idx]; }; } function iterateNode(node, level, offset) { - var values; - var array = node && node.array; - var from = offset > left ? 0 : (left - offset) >> level; - var to = ((right - offset) >> level) + 1; + let values; + const array = node && node.array; + let from = offset > left ? 0 : (left - offset) >> level; + let to = ((right - offset) >> level) + 1; if (to > SIZE) { to = SIZE; } return () => { - do { + while (true) { if (values) { - var value = values(); + const value = values(); if (value !== DONE) { return value; } @@ -341,17 +406,19 @@ function iterateList(list, reverse) { if (from === to) { return DONE; } - var idx = reverse ? --to : from++; + const idx = reverse ? --to : from++; values = iterateNodeOrLeaf( - array && array[idx], level - SHIFT, offset + (idx << level) + array && array[idx], + level - SHIFT, + offset + (idx << level) ); - } while (true); + } }; } } function makeList(origin, capacity, level, root, tail, ownerID, hash) { - var list = Object.create(ListPrototype); + const list = Object.create(ListPrototype); list.size = capacity - origin; list._origin = origin; list._capacity = capacity; @@ -364,31 +431,42 @@ function makeList(origin, capacity, level, root, tail, ownerID, hash) { return list; } -var EMPTY_LIST; export function emptyList() { - return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT)); + return makeList(0, 0, SHIFT); } function updateList(list, index, value) { index = wrapIndex(list, index); + if (index !== index) { + return list; + } + if (index >= list.size || index < 0) { - return list.withMutations(list => { - index < 0 ? - setListBounds(list, index).set(0, value) : - setListBounds(list, 0, index + 1).set(index, value) + return list.withMutations((list) => { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + index < 0 + ? setListBounds(list, index).set(0, value) + : setListBounds(list, 0, index + 1).set(index, value); }); } index += list._origin; - var newTail = list._tail; - var newRoot = list._root; - var didAlter = MakeRef(DID_ALTER); + let newTail = list._tail; + let newRoot = list._root; + const didAlter = MakeRef(); if (index >= getTailOffset(list._capacity)) { newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter); } else { - newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter); + newRoot = updateVNode( + newRoot, + list.__ownerID, + list._level, + index, + value, + didAlter + ); } if (!didAlter.value) { @@ -406,17 +484,24 @@ function updateList(list, index, value) { } function updateVNode(node, ownerID, level, index, value, didAlter) { - var idx = (index >>> level) & MASK; - var nodeHas = node && idx < node.array.length; + const idx = (index >>> level) & MASK; + const nodeHas = node && idx < node.array.length; if (!nodeHas && value === undefined) { return node; } - var newNode; + let newNode; if (level > 0) { - var lowerNode = node && node.array[idx]; - var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter); + const lowerNode = node && node.array[idx]; + const newLowerNode = updateVNode( + lowerNode, + ownerID, + level - SHIFT, + index, + value, + didAlter + ); if (newLowerNode === lowerNode) { return node; } @@ -429,7 +514,9 @@ function updateVNode(node, ownerID, level, index, value, didAlter) { return node; } - SetRef(didAlter); + if (didAlter) { + SetRef(didAlter); + } newNode = editableVNode(node, ownerID); if (value === undefined && idx === newNode.array.length - 1) { @@ -452,8 +539,8 @@ function listNodeFor(list, rawIndex) { return list._tail; } if (rawIndex < 1 << (list._level + SHIFT)) { - var node = list._root; - var level = list._level; + let node = list._root; + let level = list._level; while (node && level > 0) { node = node.array[(rawIndex >>> level) & MASK]; level -= SHIFT; @@ -463,11 +550,24 @@ function listNodeFor(list, rawIndex) { } function setListBounds(list, begin, end) { - var owner = list.__ownerID || new OwnerID(); - var oldOrigin = list._origin; - var oldCapacity = list._capacity; - var newOrigin = oldOrigin + begin; - var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end; + // Sanitize begin & end using this shorthand for ToInt32(argument) + // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 + if (begin !== undefined) { + begin |= 0; + } + if (end !== undefined) { + end |= 0; + } + const owner = list.__ownerID || new OwnerID(); + let oldOrigin = list._origin; + let oldCapacity = list._capacity; + let newOrigin = oldOrigin + begin; + let newCapacity = + end === undefined + ? oldCapacity + : end < 0 + ? oldCapacity + end + : oldOrigin + end; if (newOrigin === oldOrigin && newCapacity === oldCapacity) { return list; } @@ -477,13 +577,16 @@ function setListBounds(list, begin, end) { return list.clear(); } - var newLevel = list._level; - var newRoot = list._root; + let newLevel = list._level; + let newRoot = list._root; - // New origin might require creating a higher root. - var offsetShift = 0; + // New origin might need creating a higher root. + let offsetShift = 0; while (newOrigin + offsetShift < 0) { - newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner); + newRoot = new VNode( + newRoot && newRoot.array.length ? [undefined, newRoot] : [], + owner + ); newLevel += SHIFT; offsetShift += 1 << newLevel; } @@ -494,27 +597,38 @@ function setListBounds(list, begin, end) { oldCapacity += offsetShift; } - var oldTailOffset = getTailOffset(oldCapacity); - var newTailOffset = getTailOffset(newCapacity); + const oldTailOffset = getTailOffset(oldCapacity); + const newTailOffset = getTailOffset(newCapacity); - // New size might require creating a higher root. + // New size might need creating a higher root. while (newTailOffset >= 1 << (newLevel + SHIFT)) { - newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner); + newRoot = new VNode( + newRoot && newRoot.array.length ? [newRoot] : [], + owner + ); newLevel += SHIFT; } // Locate or create the new tail. - var oldTail = list._tail; - var newTail = newTailOffset < oldTailOffset ? - listNodeFor(list, newCapacity - 1) : - newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail; + const oldTail = list._tail; + let newTail = + newTailOffset < oldTailOffset + ? listNodeFor(list, newCapacity - 1) + : newTailOffset > oldTailOffset + ? new VNode([], owner) + : oldTail; // Merge Tail into tree. - if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) { + if ( + oldTail && + newTailOffset > oldTailOffset && + newOrigin < oldCapacity && + oldTail.array.length + ) { newRoot = editableVNode(newRoot, owner); - var node = newRoot; - for (var level = newLevel; level > SHIFT; level -= SHIFT) { - var idx = (oldTailOffset >>> level) & MASK; + let node = newRoot; + for (let level = newLevel; level > SHIFT; level -= SHIFT) { + const idx = (oldTailOffset >>> level) & MASK; node = node.array[idx] = editableVNode(node.array[idx], owner); } node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail; @@ -533,14 +647,14 @@ function setListBounds(list, begin, end) { newRoot = null; newTail = newTail && newTail.removeBefore(owner, 0, newOrigin); - // Otherwise, if the root has been trimmed, garbage collect. + // Otherwise, if the root has been trimmed, garbage collect. } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) { offsetShift = 0; // Identify the new top root node of the subtree of the old root. while (newRoot) { - var beginIndex = (newOrigin >>> newLevel) & MASK; - if (beginIndex !== (newTailOffset >>> newLevel) & MASK) { + const beginIndex = (newOrigin >>> newLevel) & MASK; + if ((beginIndex !== newTailOffset >>> newLevel) & MASK) { break; } if (beginIndex) { @@ -555,7 +669,11 @@ function setListBounds(list, begin, end) { newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift); } if (newRoot && newTailOffset < oldTailOffset) { - newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift); + newRoot = newRoot.removeAfter( + owner, + newLevel, + newTailOffset - offsetShift + ); } if (offsetShift) { newOrigin -= offsetShift; @@ -577,26 +695,6 @@ function setListBounds(list, begin, end) { return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail); } -function mergeIntoListWith(list, merger, iterables) { - var iters = []; - var maxSize = 0; - for (var ii = 0; ii < iterables.length; ii++) { - var value = iterables[ii]; - var iter = IndexedIterable(value); - if (iter.size > maxSize) { - maxSize = iter.size; - } - if (!isIterable(value)) { - iter = iter.map(v => fromJS(v)); - } - iters.push(iter); - } - if (maxSize > list.size) { - list = list.setSize(maxSize); - } - return mergeIntoCollectionWith(list, merger, iters); -} - function getTailOffset(size) { - return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT); + return size < SIZE ? 0 : ((size - 1) >>> SHIFT) << SHIFT; } diff --git a/src/Map.js b/src/Map.js index 7953b7e5d3..672e70cac4 100644 --- a/src/Map.js +++ b/src/Map.js @@ -1,40 +1,51 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { is } from './is' -import { fromJS } from './fromJS' -import { isIterable, KeyedIterable } from './Iterable' -import { KeyedCollection } from './Collection' -import { DELETE, SHIFT, SIZE, MASK, NOT_SET, CHANGE_LENGTH, DID_ALTER, OwnerID, - MakeRef, SetRef, arrCopy } from './TrieUtils' -import { hash } from './Hash' -import { Iterator, iteratorValue, iteratorDone } from './Iterator' -import { sortFactory } from './Operations' -import forceIterator from './utils/forceIterator' -import invariant from './utils/invariant' -import assertNotInfinite from './utils/assertNotInfinite' - -import { OrderedMap } from './OrderedMap' - +import { is } from './is'; +import { Collection, KeyedCollection } from './Collection'; +import { IS_MAP_SYMBOL, isMap } from './predicates/isMap'; +import { isOrdered } from './predicates/isOrdered'; +import { + DELETE, + SHIFT, + SIZE, + MASK, + NOT_SET, + OwnerID, + MakeRef, + SetRef, +} from './TrieUtils'; +import { hash } from './Hash'; +import { Iterator, iteratorValue, iteratorDone } from './Iterator'; +import { sortFactory } from './Operations'; +import arrCopy from './utils/arrCopy'; +import assertNotInfinite from './utils/assertNotInfinite'; +import { setIn } from './methods/setIn'; +import { deleteIn } from './methods/deleteIn'; +import { update } from './methods/update'; +import { updateIn } from './methods/updateIn'; +import { merge, mergeWith } from './methods/merge'; +import { mergeDeep, mergeDeepWith } from './methods/mergeDeep'; +import { mergeIn } from './methods/mergeIn'; +import { mergeDeepIn } from './methods/mergeDeepIn'; +import { withMutations } from './methods/withMutations'; +import { asMutable } from './methods/asMutable'; +import { asImmutable } from './methods/asImmutable'; +import { wasAltered } from './methods/wasAltered'; + +import { OrderedMap } from './OrderedMap'; export class Map extends KeyedCollection { - // @pragma Construction constructor(value) { - return value === null || value === undefined ? emptyMap() : - isMap(value) ? value : - emptyMap().withMutations(map => { - var iter = KeyedIterable(value); - assertNotInfinite(iter.size); - iter.forEach((v, k) => map.set(k, v)); - }); + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptyMap() + : isMap(value) && !isOrdered(value) + ? value + : emptyMap().withMutations((map) => { + const iter = KeyedCollection(value); + assertNotInfinite(iter.size); + iter.forEach((v, k) => map.set(k, v)); + }); } toString() { @@ -44,9 +55,9 @@ export class Map extends KeyedCollection { // @pragma Access get(k, notSetValue) { - return this._root ? - this._root.get(0, undefined, k, notSetValue) : - notSetValue; + return this._root + ? this._root.get(0, undefined, k, notSetValue) + : notSetValue; } // @pragma Modification @@ -55,36 +66,20 @@ export class Map extends KeyedCollection { return updateMap(this, k, v); } - setIn(keyPath, v) { - return this.updateIn(keyPath, NOT_SET, () => v); - } - remove(k) { return updateMap(this, k, NOT_SET); } - deleteIn(keyPath) { - return this.updateIn(keyPath, () => NOT_SET); - } - - update(k, notSetValue, updater) { - return arguments.length === 1 ? - k(this) : - this.updateIn([k], notSetValue, updater); - } + deleteAll(keys) { + const collection = Collection(keys); - updateIn(keyPath, notSetValue, updater) { - if (!updater) { - updater = notSetValue; - notSetValue = undefined; + if (collection.size === 0) { + return this; } - var updatedValue = updateInDeepMap( - this, - forceIterator(keyPath), - notSetValue, - updater - ); - return updatedValue === NOT_SET ? undefined : updatedValue; + + return this.withMutations((map) => { + collection.forEach((key) => map.remove(key)); + }); } clear() { @@ -103,42 +98,6 @@ export class Map extends KeyedCollection { // @pragma Composition - merge(/*...iters*/) { - return mergeIntoMapWith(this, undefined, arguments); - } - - mergeWith(merger, ...iters) { - return mergeIntoMapWith(this, merger, iters); - } - - mergeIn(keyPath, ...iters) { - return this.updateIn( - keyPath, - emptyMap(), - m => typeof m.merge === 'function' ? - m.merge.apply(m, iters) : - iters[iters.length - 1] - ); - } - - mergeDeep(/*...iters*/) { - return mergeIntoMapWith(this, deepMerger(undefined), arguments); - } - - mergeDeepWith(merger, ...iters) { - return mergeIntoMapWith(this, deepMerger(merger), iters); - } - - mergeDeepIn(keyPath, ...iters) { - return this.updateIn( - keyPath, - emptyMap(), - m => typeof m.mergeDeep === 'function' ? - m.mergeDeep.apply(m, iters) : - iters[iters.length - 1] - ); - } - sort(comparator) { // Late binding return OrderedMap(sortFactory(this, comparator)); @@ -149,36 +108,28 @@ export class Map extends KeyedCollection { return OrderedMap(sortFactory(this, comparator, mapper)); } - // @pragma Mutability - - withMutations(fn) { - var mutable = this.asMutable(); - fn(mutable); - return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this; - } - - asMutable() { - return this.__ownerID ? this : this.__ensureOwner(new OwnerID()); - } - - asImmutable() { - return this.__ensureOwner(); + map(mapper, context) { + return this.withMutations((map) => { + map.forEach((value, key) => { + map.set(key, mapper.call(context, value, key, this)); + }); + }); } - wasAltered() { - return this.__altered; - } + // @pragma Mutability __iterator(type, reverse) { return new MapIterator(this, type, reverse); } __iterate(fn, reverse) { - var iterations = 0; - this._root && this._root.iterate(entry => { - iterations++; - return fn(entry[1], entry[0], this); - }, reverse); + let iterations = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + this._root && + this._root.iterate((entry) => { + iterations++; + return fn(entry[1], entry[0], this); + }, reverse); return iterations; } @@ -187,6 +138,9 @@ export class Map extends KeyedCollection { return this; } if (!ownerID) { + if (this.size === 0) { + return emptyMap(); + } this.__ownerID = ownerID; this.__altered = false; return this; @@ -195,32 +149,44 @@ export class Map extends KeyedCollection { } } -export function isMap(maybeMap) { - return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]); -} - Map.isMap = isMap; -var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@'; - -export var MapPrototype = Map.prototype; -MapPrototype[IS_MAP_SENTINEL] = true; +const MapPrototype = Map.prototype; +MapPrototype[IS_MAP_SYMBOL] = true; MapPrototype[DELETE] = MapPrototype.remove; -MapPrototype.removeIn = MapPrototype.deleteIn; - +MapPrototype.removeAll = MapPrototype.deleteAll; +MapPrototype.setIn = setIn; +MapPrototype.removeIn = MapPrototype.deleteIn = deleteIn; +MapPrototype.update = update; +MapPrototype.updateIn = updateIn; +MapPrototype.merge = MapPrototype.concat = merge; +MapPrototype.mergeWith = mergeWith; +MapPrototype.mergeDeep = mergeDeep; +MapPrototype.mergeDeepWith = mergeDeepWith; +MapPrototype.mergeIn = mergeIn; +MapPrototype.mergeDeepIn = mergeDeepIn; +MapPrototype.withMutations = withMutations; +MapPrototype.wasAltered = wasAltered; +MapPrototype.asImmutable = asImmutable; +MapPrototype['@@transducer/init'] = MapPrototype.asMutable = asMutable; +MapPrototype['@@transducer/step'] = function (result, arr) { + return result.set(arr[0], arr[1]); +}; +MapPrototype['@@transducer/result'] = function (obj) { + return obj.asImmutable(); +}; // #pragma Trie Nodes class ArrayMapNode { - constructor(ownerID, entries) { this.ownerID = ownerID; this.entries = entries; } get(shift, keyHash, key, notSetValue) { - var entries = this.entries; - for (var ii = 0, len = entries.length; ii < len; ii++) { + const entries = this.entries; + for (let ii = 0, len = entries.length; ii < len; ii++) { if (is(key, entries[ii][0])) { return entries[ii][1]; } @@ -229,22 +195,24 @@ class ArrayMapNode { } update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { - var removed = value === NOT_SET; + const removed = value === NOT_SET; - var entries = this.entries; - var idx = 0; - for (var len = entries.length; idx < len; idx++) { + const entries = this.entries; + let idx = 0; + const len = entries.length; + for (; idx < len; idx++) { if (is(key, entries[idx][0])) { break; } } - var exists = idx < len; + const exists = idx < len; if (exists ? entries[idx][1] === value : removed) { return this; } SetRef(didAlter); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here (removed || !exists) && SetRef(didChangeSize); if (removed && entries.length === 1) { @@ -255,12 +223,15 @@ class ArrayMapNode { return createNodes(ownerID, entries, key, value); } - var isEditable = ownerID && ownerID === this.ownerID; - var newEntries = isEditable ? entries : arrCopy(entries); + const isEditable = ownerID && ownerID === this.ownerID; + const newEntries = isEditable ? entries : arrCopy(entries); if (exists) { if (removed) { - idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop()); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + idx === len - 1 + ? newEntries.pop() + : (newEntries[idx] = newEntries.pop()); } else { newEntries[idx] = [key, value]; } @@ -278,7 +249,6 @@ class ArrayMapNode { } class BitmapIndexedNode { - constructor(ownerID, bitmap, nodes) { this.ownerID = ownerID; this.bitmap = bitmap; @@ -289,29 +259,44 @@ class BitmapIndexedNode { if (keyHash === undefined) { keyHash = hash(key); } - var bit = (1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK)); - var bitmap = this.bitmap; - return (bitmap & bit) === 0 ? notSetValue : - this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, keyHash, key, notSetValue); + const bit = 1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK); + const bitmap = this.bitmap; + return (bitmap & bit) === 0 + ? notSetValue + : this.nodes[popCount(bitmap & (bit - 1))].get( + shift + SHIFT, + keyHash, + key, + notSetValue + ); } update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { if (keyHash === undefined) { keyHash = hash(key); } - var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; - var bit = 1 << keyHashFrag; - var bitmap = this.bitmap; - var exists = (bitmap & bit) !== 0; + const keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + const bit = 1 << keyHashFrag; + const bitmap = this.bitmap; + const exists = (bitmap & bit) !== 0; if (!exists && value === NOT_SET) { return this; } - var idx = popCount(bitmap & (bit - 1)); - var nodes = this.nodes; - var node = exists ? nodes[idx] : undefined; - var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); + const idx = popCount(bitmap & (bit - 1)); + const nodes = this.nodes; + const node = exists ? nodes[idx] : undefined; + const newNode = updateNode( + node, + ownerID, + shift + SHIFT, + keyHash, + key, + value, + didChangeSize, + didAlter + ); if (newNode === node) { return this; @@ -321,7 +306,12 @@ class BitmapIndexedNode { return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode); } - if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) { + if ( + exists && + !newNode && + nodes.length === 2 && + isLeafNode(nodes[idx ^ 1]) + ) { return nodes[idx ^ 1]; } @@ -329,12 +319,13 @@ class BitmapIndexedNode { return newNode; } - var isEditable = ownerID && ownerID === this.ownerID; - var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit; - var newNodes = exists ? newNode ? - setIn(nodes, idx, newNode, isEditable) : - spliceOut(nodes, idx, isEditable) : - spliceIn(nodes, idx, newNode, isEditable); + const isEditable = ownerID && ownerID === this.ownerID; + const newBitmap = exists ? (newNode ? bitmap : bitmap ^ bit) : bitmap | bit; + const newNodes = exists + ? newNode + ? setAt(nodes, idx, newNode, isEditable) + : spliceOut(nodes, idx, isEditable) + : spliceIn(nodes, idx, newNode, isEditable); if (isEditable) { this.bitmap = newBitmap; @@ -347,7 +338,6 @@ class BitmapIndexedNode { } class HashArrayMapNode { - constructor(ownerID, count, nodes) { this.ownerID = ownerID; this.count = count; @@ -358,30 +348,41 @@ class HashArrayMapNode { if (keyHash === undefined) { keyHash = hash(key); } - var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; - var node = this.nodes[idx]; - return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue; + const idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + const node = this.nodes[idx]; + return node + ? node.get(shift + SHIFT, keyHash, key, notSetValue) + : notSetValue; } update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { if (keyHash === undefined) { keyHash = hash(key); } - var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; - var removed = value === NOT_SET; - var nodes = this.nodes; - var node = nodes[idx]; + const idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + const removed = value === NOT_SET; + const nodes = this.nodes; + const node = nodes[idx]; if (removed && !node) { return this; } - var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter); + const newNode = updateNode( + node, + ownerID, + shift + SHIFT, + keyHash, + key, + value, + didChangeSize, + didAlter + ); if (newNode === node) { return this; } - var newCount = this.count; + let newCount = this.count; if (!node) { newCount++; } else if (!newNode) { @@ -391,8 +392,8 @@ class HashArrayMapNode { } } - var isEditable = ownerID && ownerID === this.ownerID; - var newNodes = setIn(nodes, idx, newNode, isEditable); + const isEditable = ownerID && ownerID === this.ownerID; + const newNodes = setAt(nodes, idx, newNode, isEditable); if (isEditable) { this.count = newCount; @@ -405,7 +406,6 @@ class HashArrayMapNode { } class HashCollisionNode { - constructor(ownerID, keyHash, entries) { this.ownerID = ownerID; this.keyHash = keyHash; @@ -413,8 +413,8 @@ class HashCollisionNode { } get(shift, keyHash, key, notSetValue) { - var entries = this.entries; - for (var ii = 0, len = entries.length; ii < len; ii++) { + const entries = this.entries; + for (let ii = 0, len = entries.length; ii < len; ii++) { if (is(key, entries[ii][0])) { return entries[ii][1]; } @@ -427,7 +427,7 @@ class HashCollisionNode { keyHash = hash(key); } - var removed = value === NOT_SET; + const removed = value === NOT_SET; if (keyHash !== this.keyHash) { if (removed) { @@ -438,32 +438,37 @@ class HashCollisionNode { return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]); } - var entries = this.entries; - var idx = 0; - for (var len = entries.length; idx < len; idx++) { + const entries = this.entries; + let idx = 0; + const len = entries.length; + for (; idx < len; idx++) { if (is(key, entries[idx][0])) { break; } } - var exists = idx < len; + const exists = idx < len; if (exists ? entries[idx][1] === value : removed) { return this; } SetRef(didAlter); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here (removed || !exists) && SetRef(didChangeSize); if (removed && len === 2) { return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]); } - var isEditable = ownerID && ownerID === this.ownerID; - var newEntries = isEditable ? entries : arrCopy(entries); + const isEditable = ownerID && ownerID === this.ownerID; + const newEntries = isEditable ? entries : arrCopy(entries); if (exists) { if (removed) { - idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop()); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + idx === len - 1 + ? newEntries.pop() + : (newEntries[idx] = newEntries.pop()); } else { newEntries[idx] = [key, value]; } @@ -481,7 +486,6 @@ class HashCollisionNode { } class ValueNode { - constructor(ownerID, keyHash, entry) { this.ownerID = ownerID; this.keyHash = keyHash; @@ -493,8 +497,8 @@ class ValueNode { } update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { - var removed = value === NOT_SET; - var keyMatch = is(key, this.entry[0]); + const removed = value === NOT_SET; + const keyMatch = is(key, this.entry[0]); if (keyMatch ? value === this.entry[1] : removed) { return this; } @@ -519,36 +523,35 @@ class ValueNode { } } - // #pragma Iterators -ArrayMapNode.prototype.iterate = -HashCollisionNode.prototype.iterate = function (fn, reverse) { - var entries = this.entries; - for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) { - if (fn(entries[reverse ? maxIndex - ii : ii]) === false) { - return false; +ArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate = + function (fn, reverse) { + const entries = this.entries; + for (let ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) { + if (fn(entries[reverse ? maxIndex - ii : ii]) === false) { + return false; + } } - } -} + }; -BitmapIndexedNode.prototype.iterate = -HashArrayMapNode.prototype.iterate = function (fn, reverse) { - var nodes = this.nodes; - for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) { - var node = nodes[reverse ? maxIndex - ii : ii]; - if (node && node.iterate(fn, reverse) === false) { - return false; +BitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate = + function (fn, reverse) { + const nodes = this.nodes; + for (let ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) { + const node = nodes[reverse ? maxIndex - ii : ii]; + if (node && node.iterate(fn, reverse) === false) { + return false; + } } - } -} + }; +// eslint-disable-next-line @typescript-eslint/no-unused-vars ValueNode.prototype.iterate = function (fn, reverse) { return fn(this.entry); -} +}; class MapIterator extends Iterator { - constructor(map, type, reverse) { this._type = type; this._reverse = reverse; @@ -556,12 +559,12 @@ class MapIterator extends Iterator { } next() { - var type = this._type; - var stack = this._stack; + const type = this._type; + let stack = this._stack; while (stack) { - var node = stack.node; - var index = stack.index++; - var maxIndex; + const node = stack.node; + const index = stack.index++; + let maxIndex; if (node.entry) { if (index === 0) { return mapIteratorValue(type, node.entry); @@ -569,12 +572,15 @@ class MapIterator extends Iterator { } else if (node.entries) { maxIndex = node.entries.length - 1; if (index <= maxIndex) { - return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]); + return mapIteratorValue( + type, + node.entries[this._reverse ? maxIndex - index : index] + ); } } else { maxIndex = node.nodes.length - 1; if (index <= maxIndex) { - var subNode = node.nodes[this._reverse ? maxIndex - index : index]; + const subNode = node.nodes[this._reverse ? maxIndex - index : index]; if (subNode) { if (subNode.entry) { return mapIteratorValue(type, subNode.entry); @@ -598,12 +604,12 @@ function mapIteratorFrame(node, prev) { return { node: node, index: 0, - __prev: prev + __prev: prev, }; } function makeMap(size, root, ownerID, hash) { - var map = Object.create(MapPrototype); + const map = Object.create(MapPrototype); map.size = size; map._root = root; map.__ownerID = ownerID; @@ -612,14 +618,14 @@ function makeMap(size, root, ownerID, hash) { return map; } -var EMPTY_MAP; +let EMPTY_MAP; export function emptyMap() { return EMPTY_MAP || (EMPTY_MAP = makeMap(0)); } function updateMap(map, k, v) { - var newRoot; - var newSize; + let newRoot; + let newSize; if (!map._root) { if (v === NOT_SET) { return map; @@ -627,13 +633,22 @@ function updateMap(map, k, v) { newSize = 1; newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]); } else { - var didChangeSize = MakeRef(CHANGE_LENGTH); - var didAlter = MakeRef(DID_ALTER); - newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter); + const didChangeSize = MakeRef(); + const didAlter = MakeRef(); + newRoot = updateNode( + map._root, + map.__ownerID, + 0, + undefined, + k, + v, + didChangeSize, + didAlter + ); if (!didAlter.value) { return map; } - newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0); + newSize = map.size + (didChangeSize.value ? (v === NOT_SET ? -1 : 1) : 0); } if (map.__ownerID) { map.size = newSize; @@ -645,7 +660,16 @@ function updateMap(map, k, v) { return newRoot ? makeMap(newSize, newRoot) : emptyMap(); } -function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) { +function updateNode( + node, + ownerID, + shift, + keyHash, + key, + value, + didChangeSize, + didAlter +) { if (!node) { if (value === NOT_SET) { return node; @@ -654,11 +678,21 @@ function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, di SetRef(didChangeSize); return new ValueNode(ownerID, keyHash, [key, value]); } - return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter); + return node.update( + ownerID, + shift, + keyHash, + key, + value, + didChangeSize, + didAlter + ); } function isLeafNode(node) { - return node.constructor === ValueNode || node.constructor === HashCollisionNode; + return ( + node.constructor === ValueNode || node.constructor === HashCollisionNode + ); } function mergeIntoNode(node, ownerID, shift, keyHash, entry) { @@ -666,13 +700,15 @@ function mergeIntoNode(node, ownerID, shift, keyHash, entry) { return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]); } - var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK; - var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; + const idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK; + const idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK; - var newNode; - var nodes = idx1 === idx2 ? - [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] : - ((newNode = new ValueNode(ownerID, keyHash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]); + let newNode; + const nodes = + idx1 === idx2 + ? [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] + : ((newNode = new ValueNode(ownerID, keyHash, entry)), + idx1 < idx2 ? [node, newNode] : [newNode, node]); return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes); } @@ -681,20 +717,20 @@ function createNodes(ownerID, entries, key, value) { if (!ownerID) { ownerID = new OwnerID(); } - var node = new ValueNode(ownerID, hash(key), [key, value]); - for (var ii = 0; ii < entries.length; ii++) { - var entry = entries[ii]; + let node = new ValueNode(ownerID, hash(key), [key, value]); + for (let ii = 0; ii < entries.length; ii++) { + const entry = entries[ii]; node = node.update(ownerID, 0, undefined, entry[0], entry[1]); } return node; } function packNodes(ownerID, nodes, count, excluding) { - var bitmap = 0; - var packedII = 0; - var packedNodes = new Array(count); - for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) { - var node = nodes[ii]; + let bitmap = 0; + let packedII = 0; + const packedNodes = new Array(count); + for (let ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) { + const node = nodes[ii]; if (node !== undefined && ii !== excluding) { bitmap |= bit; packedNodes[packedII++] = node; @@ -704,108 +740,39 @@ function packNodes(ownerID, nodes, count, excluding) { } function expandNodes(ownerID, nodes, bitmap, including, node) { - var count = 0; - var expandedNodes = new Array(SIZE); - for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) { + let count = 0; + const expandedNodes = new Array(SIZE); + for (let ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) { expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined; } expandedNodes[including] = node; return new HashArrayMapNode(ownerID, count + 1, expandedNodes); } -function mergeIntoMapWith(map, merger, iterables) { - var iters = []; - for (var ii = 0; ii < iterables.length; ii++) { - var value = iterables[ii]; - var iter = KeyedIterable(value); - if (!isIterable(value)) { - iter = iter.map(v => fromJS(v)); - } - iters.push(iter); - } - return mergeIntoCollectionWith(map, merger, iters); -} - -export function deepMerger(merger) { - return (existing, value, key) => - existing && existing.mergeDeepWith && isIterable(value) ? - existing.mergeDeepWith(merger, value) : - merger ? merger(existing, value, key) : value; -} - -export function mergeIntoCollectionWith(collection, merger, iters) { - iters = iters.filter(x => x.size !== 0); - if (iters.length === 0) { - return collection; - } - if (collection.size === 0 && !collection.__ownerID && iters.length === 1) { - return collection.constructor(iters[0]); - } - return collection.withMutations(collection => { - var mergeIntoMap = merger ? - (value, key) => { - collection.update(key, NOT_SET, existing => - existing === NOT_SET ? value : merger(existing, value, key) - ); - } : - (value, key) => { - collection.set(key, value); - } - for (var ii = 0; ii < iters.length; ii++) { - iters[ii].forEach(mergeIntoMap); - } - }); -} - -function updateInDeepMap(existing, keyPathIter, notSetValue, updater) { - var isNotSet = existing === NOT_SET; - var step = keyPathIter.next(); - if (step.done) { - var existingValue = isNotSet ? notSetValue : existing; - var newValue = updater(existingValue); - return newValue === existingValue ? existing : newValue; - } - invariant( - isNotSet || (existing && existing.set), - 'invalid keyPath' - ); - var key = step.value; - var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET); - var nextUpdated = updateInDeepMap( - nextExisting, - keyPathIter, - notSetValue, - updater - ); - return nextUpdated === nextExisting ? existing : - nextUpdated === NOT_SET ? existing.remove(key) : - (isNotSet ? emptyMap() : existing).set(key, nextUpdated); -} - function popCount(x) { - x = x - ((x >> 1) & 0x55555555); + x -= (x >> 1) & 0x55555555; x = (x & 0x33333333) + ((x >> 2) & 0x33333333); x = (x + (x >> 4)) & 0x0f0f0f0f; - x = x + (x >> 8); - x = x + (x >> 16); + x += x >> 8; + x += x >> 16; return x & 0x7f; } -function setIn(array, idx, val, canEdit) { - var newArray = canEdit ? array : arrCopy(array); +function setAt(array, idx, val, canEdit) { + const newArray = canEdit ? array : arrCopy(array); newArray[idx] = val; return newArray; } function spliceIn(array, idx, val, canEdit) { - var newLen = array.length + 1; + const newLen = array.length + 1; if (canEdit && idx + 1 === newLen) { array[idx] = val; return array; } - var newArray = new Array(newLen); - var after = 0; - for (var ii = 0; ii < newLen; ii++) { + const newArray = new Array(newLen); + let after = 0; + for (let ii = 0; ii < newLen; ii++) { if (ii === idx) { newArray[ii] = val; after = -1; @@ -817,14 +784,14 @@ function spliceIn(array, idx, val, canEdit) { } function spliceOut(array, idx, canEdit) { - var newLen = array.length - 1; + const newLen = array.length - 1; if (canEdit && idx === newLen) { array.pop(); return array; } - var newArray = new Array(newLen); - var after = 0; - for (var ii = 0; ii < newLen; ii++) { + const newArray = new Array(newLen); + let after = 0; + for (let ii = 0; ii < newLen; ii++) { if (ii === idx) { after = 1; } @@ -833,6 +800,6 @@ function spliceOut(array, idx, canEdit) { return newArray; } -var MAX_ARRAY_MAP_SIZE = SIZE / 4; -var MAX_BITMAP_INDEXED_SIZE = SIZE / 2; -var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4; +const MAX_ARRAY_MAP_SIZE = SIZE / 4; +const MAX_BITMAP_INDEXED_SIZE = SIZE / 2; +const MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4; diff --git a/src/Math.js b/src/Math.js index 7f5570b01b..0075e73cd3 100644 --- a/src/Math.js +++ b/src/Math.js @@ -1,28 +1,19 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -export var imul = - typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ? - Math.imul : - function imul(a, b) { - a = a | 0; // int - b = b | 0; // int - var c = a & 0xffff; - var d = b & 0xffff; - // Shift by 0 fixes the sign on the high part. - return (c * d) + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0) | 0; // int - }; +export const imul = + typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 + ? Math.imul + : function imul(a, b) { + a |= 0; // int + b |= 0; // int + const c = a & 0xffff; + const d = b & 0xffff; + // Shift by 0 fixes the sign on the high part. + return (c * d + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0)) | 0; // int + }; // v8 has an optimization for storing 31-bit signed numbers. // Values which have either 00 or 11 as the high order bits qualify. // This function drops the highest order bit in a signed number, maintaining // the sign bit. export function smi(i32) { - return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF); + return ((i32 >>> 1) & 0x40000000) | (i32 & 0xbfffffff); } diff --git a/src/Operations.js b/src/Operations.js index f7733f1f54..bb3b16568d 100644 --- a/src/Operations.js +++ b/src/Operations.js @@ -1,26 +1,43 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { NOT_SET, ensureSize, wrapIndex, wholeSlice, resolveBegin, resolveEnd } from './TrieUtils' -import { isIterable, isKeyed, isIndexed, isOrdered, - Iterable, KeyedIterable, SetIterable, IndexedIterable, - IS_ORDERED_SENTINEL } from './Iterable' -import { getIterator, Iterator, iteratorValue, iteratorDone, - ITERATE_KEYS, ITERATE_VALUES, ITERATE_ENTRIES } from './Iterator' -import { isSeq, Seq, KeyedSeq, SetSeq, IndexedSeq, - keyedSeqFromValue, indexedSeqFromValue, ArraySeq } from './Seq' - -import assertNotInfinite from './utils/assertNotInfinite' - -import { Map } from './Map' -import { OrderedMap } from './OrderedMap' - +import { + NOT_SET, + ensureSize, + wrapIndex, + wholeSlice, + resolveBegin, + resolveEnd, +} from './TrieUtils'; +import { + Collection, + KeyedCollection, + SetCollection, + IndexedCollection, +} from './Collection'; +import { isCollection } from './predicates/isCollection'; +import { IS_KEYED_SYMBOL, isKeyed } from './predicates/isKeyed'; +import { IS_INDEXED_SYMBOL, isIndexed } from './predicates/isIndexed'; +import { isOrdered, IS_ORDERED_SYMBOL } from './predicates/isOrdered'; +import { isSeq } from './predicates/isSeq'; +import { + getIterator, + Iterator, + iteratorValue, + iteratorDone, + ITERATE_KEYS, + ITERATE_VALUES, + ITERATE_ENTRIES, +} from './Iterator'; +import { + Seq, + KeyedSeq, + SetSeq, + IndexedSeq, + keyedSeqFromValue, + indexedSeqFromValue, + ArraySeq, +} from './Seq'; + +import { Map } from './Map'; +import { OrderedMap } from './OrderedMap'; export class ToKeyedSequence extends KeyedSeq { constructor(indexed, useKeys) { @@ -42,7 +59,7 @@ export class ToKeyedSequence extends KeyedSeq { } reverse() { - var reversedSequence = reverseFactory(this, true); + const reversedSequence = reverseFactory(this, true); if (!this._useKeys) { reversedSequence.valueSeq = () => this._iter.toSeq().reverse(); } @@ -50,7 +67,7 @@ export class ToKeyedSequence extends KeyedSeq { } map(mapper, context) { - var mappedSequence = mapFactory(this, mapper, context); + const mappedSequence = mapFactory(this, mapper, context); if (!this._useKeys) { mappedSequence.valueSeq = () => this._iter.toSeq().map(mapper, context); } @@ -58,31 +75,14 @@ export class ToKeyedSequence extends KeyedSeq { } __iterate(fn, reverse) { - var ii; - return this._iter.__iterate( - this._useKeys ? - (v, k) => fn(v, k, this) : - ((ii = reverse ? resolveSize(this) : 0), - v => fn(v, reverse ? --ii : ii++, this)), - reverse - ); + return this._iter.__iterate((v, k) => fn(v, k, this), reverse); } __iterator(type, reverse) { - if (this._useKeys) { - return this._iter.__iterator(type, reverse); - } - var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); - var ii = reverse ? resolveSize(this) : 0; - return new Iterator(() => { - var step = iterator.next(); - return step.done ? step : - iteratorValue(type, reverse ? --ii : ii++, step.value, step); - }); + return this._iter.__iterator(type, reverse); } } -ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true; - +ToKeyedSequence.prototype[IS_ORDERED_SYMBOL] = true; export class ToIndexedSequence extends IndexedSeq { constructor(iter) { @@ -95,22 +95,34 @@ export class ToIndexedSequence extends IndexedSeq { } __iterate(fn, reverse) { - var iterations = 0; - return this._iter.__iterate(v => fn(v, iterations++, this), reverse); + let i = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + reverse && ensureSize(this); + return this._iter.__iterate( + (v) => fn(v, reverse ? this.size - ++i : i++, this), + reverse + ); } __iterator(type, reverse) { - var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); - var iterations = 0; + const iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + let i = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + reverse && ensureSize(this); return new Iterator(() => { - var step = iterator.next(); - return step.done ? step : - iteratorValue(type, iterations++, step.value, step) + const step = iterator.next(); + return step.done + ? step + : iteratorValue( + type, + reverse ? this.size - ++i : i++, + step.value, + step + ); }); } } - export class ToSetSequence extends SetSeq { constructor(iter) { this._iter = iter; @@ -122,20 +134,20 @@ export class ToSetSequence extends SetSeq { } __iterate(fn, reverse) { - return this._iter.__iterate(v => fn(v, v, this), reverse); + return this._iter.__iterate((v) => fn(v, v, this), reverse); } __iterator(type, reverse) { - var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + const iterator = this._iter.__iterator(ITERATE_VALUES, reverse); return new Iterator(() => { - var step = iterator.next(); - return step.done ? step : - iteratorValue(type, step.value, step.value, step); + const step = iterator.next(); + return step.done + ? step + : iteratorValue(type, step.value, step.value, step); }); } } - export class FromEntriesSequence extends KeyedSeq { constructor(entries) { this._iter = entries; @@ -147,15 +159,15 @@ export class FromEntriesSequence extends KeyedSeq { } __iterate(fn, reverse) { - return this._iter.__iterate(entry => { + return this._iter.__iterate((entry) => { // Check if entry exists first so array access doesn't throw for holes // in the parent iteration. if (entry) { validateEntry(entry); - var indexedIterable = isIterable(entry); + const indexedCollection = isCollection(entry); return fn( - indexedIterable ? entry.get(1) : entry[1], - indexedIterable ? entry.get(0) : entry[0], + indexedCollection ? entry.get(1) : entry[1], + indexedCollection ? entry.get(0) : entry[0], this ); } @@ -163,23 +175,23 @@ export class FromEntriesSequence extends KeyedSeq { } __iterator(type, reverse) { - var iterator = this._iter.__iterator(ITERATE_VALUES, reverse); + const iterator = this._iter.__iterator(ITERATE_VALUES, reverse); return new Iterator(() => { while (true) { - var step = iterator.next(); + const step = iterator.next(); if (step.done) { return step; } - var entry = step.value; + const entry = step.value; // Check if entry exists first so array access doesn't throw for holes // in the parent iteration. if (entry) { validateEntry(entry); - var indexedIterable = isIterable(entry); + const indexedCollection = isCollection(entry); return iteratorValue( type, - indexedIterable ? entry.get(0) : entry[0], - indexedIterable ? entry.get(1) : entry[1], + indexedCollection ? entry.get(0) : entry[0], + indexedCollection ? entry.get(1) : entry[1], step ); } @@ -189,130 +201,149 @@ export class FromEntriesSequence extends KeyedSeq { } ToIndexedSequence.prototype.cacheResult = -ToKeyedSequence.prototype.cacheResult = -ToSetSequence.prototype.cacheResult = -FromEntriesSequence.prototype.cacheResult = - cacheResultThrough; - - -export function flipFactory(iterable) { - var flipSequence = makeSequence(iterable); - flipSequence._iter = iterable; - flipSequence.size = iterable.size; - flipSequence.flip = () => iterable; + ToKeyedSequence.prototype.cacheResult = + ToSetSequence.prototype.cacheResult = + FromEntriesSequence.prototype.cacheResult = + cacheResultThrough; + +export function flipFactory(collection) { + const flipSequence = makeSequence(collection); + flipSequence._iter = collection; + flipSequence.size = collection.size; + flipSequence.flip = () => collection; flipSequence.reverse = function () { - var reversedSequence = iterable.reverse.apply(this); // super.reverse() - reversedSequence.flip = () => iterable.reverse(); + const reversedSequence = collection.reverse.apply(this); // super.reverse() + reversedSequence.flip = () => collection.reverse(); return reversedSequence; }; - flipSequence.has = key => iterable.includes(key); - flipSequence.includes = key => iterable.has(key); + flipSequence.has = (key) => collection.includes(key); + flipSequence.includes = (key) => collection.has(key); flipSequence.cacheResult = cacheResultThrough; flipSequence.__iterateUncached = function (fn, reverse) { - return iterable.__iterate((v, k) => fn(k, v, this) !== false, reverse); - } - flipSequence.__iteratorUncached = function(type, reverse) { + return collection.__iterate((v, k) => fn(k, v, this) !== false, reverse); + }; + flipSequence.__iteratorUncached = function (type, reverse) { if (type === ITERATE_ENTRIES) { - var iterator = iterable.__iterator(type, reverse); + const iterator = collection.__iterator(type, reverse); return new Iterator(() => { - var step = iterator.next(); + const step = iterator.next(); if (!step.done) { - var k = step.value[0]; + const k = step.value[0]; step.value[0] = step.value[1]; step.value[1] = k; } return step; }); } - return iterable.__iterator( + return collection.__iterator( type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, reverse ); - } + }; return flipSequence; } - -export function mapFactory(iterable, mapper, context) { - var mappedSequence = makeSequence(iterable); - mappedSequence.size = iterable.size; - mappedSequence.has = key => iterable.has(key); +export function mapFactory(collection, mapper, context) { + const mappedSequence = makeSequence(collection); + mappedSequence.size = collection.size; + mappedSequence.has = (key) => collection.has(key); mappedSequence.get = (key, notSetValue) => { - var v = iterable.get(key, NOT_SET); - return v === NOT_SET ? - notSetValue : - mapper.call(context, v, key, iterable); + const v = collection.get(key, NOT_SET); + return v === NOT_SET + ? notSetValue + : mapper.call(context, v, key, collection); }; mappedSequence.__iterateUncached = function (fn, reverse) { - return iterable.__iterate( + return collection.__iterate( (v, k, c) => fn(mapper.call(context, v, k, c), k, this) !== false, reverse ); - } + }; mappedSequence.__iteratorUncached = function (type, reverse) { - var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); + const iterator = collection.__iterator(ITERATE_ENTRIES, reverse); return new Iterator(() => { - var step = iterator.next(); + const step = iterator.next(); if (step.done) { return step; } - var entry = step.value; - var key = entry[0]; + const entry = step.value; + const key = entry[0]; return iteratorValue( type, key, - mapper.call(context, entry[1], key, iterable), + mapper.call(context, entry[1], key, collection), step ); }); - } + }; return mappedSequence; } - -export function reverseFactory(iterable, useKeys) { - var reversedSequence = makeSequence(iterable); - reversedSequence._iter = iterable; - reversedSequence.size = iterable.size; - reversedSequence.reverse = () => iterable; - if (iterable.flip) { +export function reverseFactory(collection, useKeys) { + const reversedSequence = makeSequence(collection); + reversedSequence._iter = collection; + reversedSequence.size = collection.size; + reversedSequence.reverse = () => collection; + if (collection.flip) { reversedSequence.flip = function () { - var flipSequence = flipFactory(iterable); - flipSequence.reverse = () => iterable.flip(); + const flipSequence = flipFactory(collection); + flipSequence.reverse = () => collection.flip(); return flipSequence; }; } reversedSequence.get = (key, notSetValue) => - iterable.get(useKeys ? key : -1 - key, notSetValue); - reversedSequence.has = key => - iterable.has(useKeys ? key : -1 - key); - reversedSequence.includes = value => iterable.includes(value); + collection.get(useKeys ? key : -1 - key, notSetValue); + reversedSequence.has = (key) => collection.has(useKeys ? key : -1 - key); + reversedSequence.includes = (value) => collection.includes(value); reversedSequence.cacheResult = cacheResultThrough; reversedSequence.__iterate = function (fn, reverse) { - return iterable.__iterate((v, k) => fn(v, k, this), !reverse); + let i = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + reverse && ensureSize(collection); + return collection.__iterate( + (v, k) => fn(v, useKeys ? k : reverse ? this.size - ++i : i++, this), + !reverse + ); + }; + reversedSequence.__iterator = (type, reverse) => { + let i = 0; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + reverse && ensureSize(collection); + const iterator = collection.__iterator(ITERATE_ENTRIES, !reverse); + return new Iterator(() => { + const step = iterator.next(); + if (step.done) { + return step; + } + const entry = step.value; + return iteratorValue( + type, + useKeys ? entry[0] : reverse ? this.size - ++i : i++, + entry[1], + step + ); + }); }; - reversedSequence.__iterator = - (type, reverse) => iterable.__iterator(type, !reverse); return reversedSequence; } - -export function filterFactory(iterable, predicate, context, useKeys) { - var filterSequence = makeSequence(iterable); +export function filterFactory(collection, predicate, context, useKeys) { + const filterSequence = makeSequence(collection); if (useKeys) { - filterSequence.has = key => { - var v = iterable.get(key, NOT_SET); - return v !== NOT_SET && !!predicate.call(context, v, key, iterable); + filterSequence.has = (key) => { + const v = collection.get(key, NOT_SET); + return v !== NOT_SET && !!predicate.call(context, v, key, collection); }; filterSequence.get = (key, notSetValue) => { - var v = iterable.get(key, NOT_SET); - return v !== NOT_SET && predicate.call(context, v, key, iterable) ? - v : notSetValue; + const v = collection.get(key, NOT_SET); + return v !== NOT_SET && predicate.call(context, v, key, collection) + ? v + : notSetValue; }; } filterSequence.__iterateUncached = function (fn, reverse) { - var iterations = 0; - iterable.__iterate((v, k, c) => { + let iterations = 0; + collection.__iterate((v, k, c) => { if (predicate.call(context, v, k, c)) { iterations++; return fn(v, useKeys ? k : iterations - 1, this); @@ -321,122 +352,135 @@ export function filterFactory(iterable, predicate, context, useKeys) { return iterations; }; filterSequence.__iteratorUncached = function (type, reverse) { - var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); - var iterations = 0; + const iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + let iterations = 0; return new Iterator(() => { while (true) { - var step = iterator.next(); + const step = iterator.next(); if (step.done) { return step; } - var entry = step.value; - var key = entry[0]; - var value = entry[1]; - if (predicate.call(context, value, key, iterable)) { + const entry = step.value; + const key = entry[0]; + const value = entry[1]; + if (predicate.call(context, value, key, collection)) { return iteratorValue(type, useKeys ? key : iterations++, value, step); } } }); - } + }; return filterSequence; } - -export function countByFactory(iterable, grouper, context) { - var groups = Map().asMutable(); - iterable.__iterate((v, k) => { - groups.update( - grouper.call(context, v, k, iterable), - 0, - a => a + 1 - ); +export function countByFactory(collection, grouper, context) { + const groups = Map().asMutable(); + collection.__iterate((v, k) => { + groups.update(grouper.call(context, v, k, collection), 0, (a) => a + 1); }); return groups.asImmutable(); } - -export function groupByFactory(iterable, grouper, context) { - var isKeyedIter = isKeyed(iterable); - var groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable(); - iterable.__iterate((v, k) => { +export function groupByFactory(collection, grouper, context) { + const isKeyedIter = isKeyed(collection); + const groups = (isOrdered(collection) ? OrderedMap() : Map()).asMutable(); + collection.__iterate((v, k) => { groups.update( - grouper.call(context, v, k, iterable), - a => (a = a || [], a.push(isKeyedIter ? [k, v] : v), a) + grouper.call(context, v, k, collection), + (a) => ((a = a || []), a.push(isKeyedIter ? [k, v] : v), a) ); }); - var coerce = iterableClass(iterable); - return groups.map(arr => reify(iterable, coerce(arr))); + const coerce = collectionClass(collection); + return groups.map((arr) => reify(collection, coerce(arr))).asImmutable(); } +export function partitionFactory(collection, predicate, context) { + const isKeyedIter = isKeyed(collection); + const groups = [[], []]; + collection.__iterate((v, k) => { + groups[predicate.call(context, v, k, collection) ? 1 : 0].push( + isKeyedIter ? [k, v] : v + ); + }); + const coerce = collectionClass(collection); + return groups.map((arr) => reify(collection, coerce(arr))); +} -export function sliceFactory(iterable, begin, end, useKeys) { - var originalSize = iterable.size; +export function sliceFactory(collection, begin, end, useKeys) { + const originalSize = collection.size; if (wholeSlice(begin, end, originalSize)) { - return iterable; + return collection; } - var resolvedBegin = resolveBegin(begin, originalSize); - var resolvedEnd = resolveEnd(end, originalSize); - - // begin or end will be NaN if they were provided as negative numbers and - // this iterable's size is unknown. In that case, cache first so there is + // begin or end can not be resolved if they were provided as negative numbers and + // this collection's size is unknown. In that case, cache first so there is // a known size and these do not resolve to NaN. - if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) { - return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys); + if (typeof originalSize === 'undefined' && (begin < 0 || end < 0)) { + return sliceFactory(collection.toSeq().cacheResult(), begin, end, useKeys); } + const resolvedBegin = resolveBegin(begin, originalSize); + const resolvedEnd = resolveEnd(end, originalSize); + // Note: resolvedEnd is undefined when the original sequence's length is // unknown and this slice did not supply an end and should contain all // elements after resolvedBegin. // In that case, resolvedSize will be NaN and sliceSize will remain undefined. - var resolvedSize = resolvedEnd - resolvedBegin; - var sliceSize; + const resolvedSize = resolvedEnd - resolvedBegin; + let sliceSize; if (resolvedSize === resolvedSize) { sliceSize = resolvedSize < 0 ? 0 : resolvedSize; } - var sliceSeq = makeSequence(iterable); + const sliceSeq = makeSequence(collection); - sliceSeq.size = sliceSize; + // If collection.size is undefined, the size of the realized sliceSeq is + // unknown at this point unless the number of items to slice is 0 + sliceSeq.size = + sliceSize === 0 ? sliceSize : (collection.size && sliceSize) || undefined; - if (!useKeys && isSeq(iterable) && sliceSize >= 0) { + if (!useKeys && isSeq(collection) && sliceSize >= 0) { sliceSeq.get = function (index, notSetValue) { index = wrapIndex(this, index); - return index >= 0 && index < sliceSize ? - iterable.get(index + resolvedBegin, notSetValue) : - notSetValue; - } + return index >= 0 && index < sliceSize + ? collection.get(index + resolvedBegin, notSetValue) + : notSetValue; + }; } - sliceSeq.__iterateUncached = function(fn, reverse) { + sliceSeq.__iterateUncached = function (fn, reverse) { if (sliceSize === 0) { return 0; } if (reverse) { return this.cacheResult().__iterate(fn, reverse); } - var skipped = 0; - var isSkipping = true; - var iterations = 0; - iterable.__iterate((v, k) => { + let skipped = 0; + let isSkipping = true; + let iterations = 0; + collection.__iterate((v, k) => { if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) { iterations++; - return fn(v, useKeys ? k : iterations - 1, this) !== false && - iterations !== sliceSize; + return ( + fn(v, useKeys ? k : iterations - 1, this) !== false && + iterations !== sliceSize + ); } }); return iterations; }; - sliceSeq.__iteratorUncached = function(type, reverse) { + sliceSeq.__iteratorUncached = function (type, reverse) { if (sliceSize !== 0 && reverse) { return this.cacheResult().__iterator(type, reverse); } // Don't bother instantiating parent iterator if taking 0. - var iterator = sliceSize !== 0 && iterable.__iterator(type, reverse); - var skipped = 0; - var iterations = 0; + if (sliceSize === 0) { + return new Iterator(iteratorDone); + } + const iterator = collection.__iterator(type, reverse); + let skipped = 0; + let iterations = 0; return new Iterator(() => { while (skipped++ < resolvedBegin) { iterator.next(); @@ -444,71 +488,69 @@ export function sliceFactory(iterable, begin, end, useKeys) { if (++iterations > sliceSize) { return iteratorDone(); } - var step = iterator.next(); - if (useKeys || type === ITERATE_VALUES) { + const step = iterator.next(); + if (useKeys || type === ITERATE_VALUES || step.done) { return step; - } else if (type === ITERATE_KEYS) { + } + if (type === ITERATE_KEYS) { return iteratorValue(type, iterations - 1, undefined, step); - } else { - return iteratorValue(type, iterations - 1, step.value[1], step); } + return iteratorValue(type, iterations - 1, step.value[1], step); }); - } + }; return sliceSeq; } - -export function takeWhileFactory(iterable, predicate, context) { - var takeSequence = makeSequence(iterable); - takeSequence.__iterateUncached = function(fn, reverse) { +export function takeWhileFactory(collection, predicate, context) { + const takeSequence = makeSequence(collection); + takeSequence.__iterateUncached = function (fn, reverse) { if (reverse) { return this.cacheResult().__iterate(fn, reverse); } - var iterations = 0; - iterable.__iterate((v, k, c) => - predicate.call(context, v, k, c) && ++iterations && fn(v, k, this) + let iterations = 0; + collection.__iterate( + (v, k, c) => + predicate.call(context, v, k, c) && ++iterations && fn(v, k, this) ); return iterations; }; - takeSequence.__iteratorUncached = function(type, reverse) { + takeSequence.__iteratorUncached = function (type, reverse) { if (reverse) { return this.cacheResult().__iterator(type, reverse); } - var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); - var iterating = true; + const iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + let iterating = true; return new Iterator(() => { if (!iterating) { return iteratorDone(); } - var step = iterator.next(); + const step = iterator.next(); if (step.done) { return step; } - var entry = step.value; - var k = entry[0]; - var v = entry[1]; + const entry = step.value; + const k = entry[0]; + const v = entry[1]; if (!predicate.call(context, v, k, this)) { iterating = false; return iteratorDone(); } - return type === ITERATE_ENTRIES ? step : - iteratorValue(type, k, v, step); + return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); }); }; return takeSequence; } - -export function skipWhileFactory(iterable, predicate, context, useKeys) { - var skipSequence = makeSequence(iterable); +export function skipWhileFactory(collection, predicate, context, useKeys) { + const skipSequence = makeSequence(collection); skipSequence.__iterateUncached = function (fn, reverse) { if (reverse) { return this.cacheResult().__iterate(fn, reverse); } - var isSkipping = true; - var iterations = 0; - iterable.__iterate((v, k, c) => { + let isSkipping = true; + let iterations = 0; + collection.__iterate((v, k, c) => { if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) { iterations++; return fn(v, useKeys ? k : iterations - 1, this); @@ -516,121 +558,211 @@ export function skipWhileFactory(iterable, predicate, context, useKeys) { }); return iterations; }; - skipSequence.__iteratorUncached = function(type, reverse) { + skipSequence.__iteratorUncached = function (type, reverse) { if (reverse) { return this.cacheResult().__iterator(type, reverse); } - var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse); - var skipping = true; - var iterations = 0; + const iterator = collection.__iterator(ITERATE_ENTRIES, reverse); + let skipping = true; + let iterations = 0; return new Iterator(() => { - var step, k, v; + let step; + let k; + let v; do { step = iterator.next(); if (step.done) { if (useKeys || type === ITERATE_VALUES) { return step; - } else if (type === ITERATE_KEYS) { + } + if (type === ITERATE_KEYS) { return iteratorValue(type, iterations++, undefined, step); - } else { - return iteratorValue(type, iterations++, step.value[1], step); } + return iteratorValue(type, iterations++, step.value[1], step); } - var entry = step.value; + const entry = step.value; k = entry[0]; v = entry[1]; + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here skipping && (skipping = predicate.call(context, v, k, this)); } while (skipping); - return type === ITERATE_ENTRIES ? step : - iteratorValue(type, k, v, step); + return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step); }); }; return skipSequence; } +class ConcatSeq extends Seq { + constructor(iterables) { + this._wrappedIterables = iterables.flatMap((iterable) => { + if (iterable._wrappedIterables) { + return iterable._wrappedIterables; + } + return [iterable]; + }); + this.size = this._wrappedIterables.reduce((sum, iterable) => { + if (sum !== undefined) { + const size = iterable.size; + if (size !== undefined) { + return sum + size; + } + } + }, 0); + this[IS_KEYED_SYMBOL] = this._wrappedIterables[0][IS_KEYED_SYMBOL]; + this[IS_INDEXED_SYMBOL] = this._wrappedIterables[0][IS_INDEXED_SYMBOL]; + this[IS_ORDERED_SYMBOL] = this._wrappedIterables[0][IS_ORDERED_SYMBOL]; + } -export function concatFactory(iterable, values) { - var isKeyedIterable = isKeyed(iterable); - var iters = [iterable].concat(values).map(v => { - if (!isIterable(v)) { - v = isKeyedIterable ? - keyedSeqFromValue(v) : - indexedSeqFromValue(Array.isArray(v) ? v : [v]); - } else if (isKeyedIterable) { - v = KeyedIterable(v); + __iterateUncached(fn, reverse) { + if (this._wrappedIterables.length === 0) { + return; } - return v; - }).filter(v => v.size !== 0); + + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + + let iterableIndex = 0; + const useKeys = isKeyed(this); + const iteratorType = useKeys ? ITERATE_ENTRIES : ITERATE_VALUES; + let currentIterator = this._wrappedIterables[iterableIndex].__iterator( + iteratorType, + reverse + ); + + let keepGoing = true; + let index = 0; + while (keepGoing) { + let next = currentIterator.next(); + while (next.done) { + iterableIndex++; + if (iterableIndex === this._wrappedIterables.length) { + return index; + } + currentIterator = this._wrappedIterables[iterableIndex].__iterator( + iteratorType, + reverse + ); + next = currentIterator.next(); + } + const fnResult = useKeys + ? fn(next.value[1], next.value[0], this) + : fn(next.value, index, this); + keepGoing = fnResult !== false; + index++; + } + return index; + } + + __iteratorUncached(type, reverse) { + if (this._wrappedIterables.length === 0) { + return new Iterator(iteratorDone); + } + + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + + let iterableIndex = 0; + let currentIterator = this._wrappedIterables[iterableIndex].__iterator( + type, + reverse + ); + return new Iterator(() => { + let next = currentIterator.next(); + while (next.done) { + iterableIndex++; + if (iterableIndex === this._wrappedIterables.length) { + return next; + } + currentIterator = this._wrappedIterables[iterableIndex].__iterator( + type, + reverse + ); + next = currentIterator.next(); + } + return next; + }); + } +} + +export function concatFactory(collection, values) { + const isKeyedCollection = isKeyed(collection); + const iters = [collection] + .concat(values) + .map((v) => { + if (!isCollection(v)) { + v = isKeyedCollection + ? keyedSeqFromValue(v) + : indexedSeqFromValue(Array.isArray(v) ? v : [v]); + } else if (isKeyedCollection) { + v = KeyedCollection(v); + } + return v; + }) + .filter((v) => v.size !== 0); if (iters.length === 0) { - return iterable; + return collection; } if (iters.length === 1) { - var singleton = iters[0]; - if (singleton === iterable || - isKeyedIterable && isKeyed(singleton) || - isIndexed(iterable) && isIndexed(singleton)) { + const singleton = iters[0]; + if ( + singleton === collection || + (isKeyedCollection && isKeyed(singleton)) || + (isIndexed(collection) && isIndexed(singleton)) + ) { return singleton; } } - var concatSeq = new ArraySeq(iters); - if (isKeyedIterable) { - concatSeq = concatSeq.toKeyedSeq(); - } else if (!isIndexed(iterable)) { - concatSeq = concatSeq.toSetSeq(); - } - concatSeq = concatSeq.flatten(true); - concatSeq.size = iters.reduce( - (sum, seq) => { - if (sum !== undefined) { - var size = seq.size; - if (size !== undefined) { - return sum + size; - } - } - }, - 0 - ); - return concatSeq; + return new ConcatSeq(iters); } - -export function flattenFactory(iterable, depth, useKeys) { - var flatSequence = makeSequence(iterable); - flatSequence.__iterateUncached = function(fn, reverse) { - var iterations = 0; - var stopped = false; +export function flattenFactory(collection, depth, useKeys) { + const flatSequence = makeSequence(collection); + flatSequence.__iterateUncached = function (fn, reverse) { + if (reverse) { + return this.cacheResult().__iterate(fn, reverse); + } + let iterations = 0; + let stopped = false; function flatDeep(iter, currentDepth) { iter.__iterate((v, k) => { - if ((!depth || currentDepth < depth) && isIterable(v)) { + if ((!depth || currentDepth < depth) && isCollection(v)) { flatDeep(v, currentDepth + 1); - } else if (fn(v, useKeys ? k : iterations++, this) === false) { - stopped = true; + } else { + iterations++; + if (fn(v, useKeys ? k : iterations - 1, flatSequence) === false) { + stopped = true; + } } return !stopped; }, reverse); } - flatDeep(iterable, 0); + flatDeep(collection, 0); return iterations; - } - flatSequence.__iteratorUncached = function(type, reverse) { - var iterator = iterable.__iterator(type, reverse); - var stack = []; - var iterations = 0; + }; + flatSequence.__iteratorUncached = function (type, reverse) { + if (reverse) { + return this.cacheResult().__iterator(type, reverse); + } + let iterator = collection.__iterator(type, reverse); + const stack = []; + let iterations = 0; return new Iterator(() => { while (iterator) { - var step = iterator.next(); + const step = iterator.next(); if (step.done !== false) { iterator = stack.pop(); continue; } - var v = step.value; + let v = step.value; if (type === ITERATE_ENTRIES) { v = v[1]; } - if ((!depth || stack.length < depth) && isIterable(v)) { + if ((!depth || stack.length < depth) && isCollection(v)) { stack.push(iterator); iterator = v.__iterator(type, reverse); } else { @@ -639,35 +771,35 @@ export function flattenFactory(iterable, depth, useKeys) { } return iteratorDone(); }); - } + }; return flatSequence; } - -export function flatMapFactory(iterable, mapper, context) { - var coerce = iterableClass(iterable); - return iterable.toSeq().map( - (v, k) => coerce(mapper.call(context, v, k, iterable)) - ).flatten(true); +export function flatMapFactory(collection, mapper, context) { + const coerce = collectionClass(collection); + return collection + .toSeq() + .map((v, k) => coerce(mapper.call(context, v, k, collection))) + .flatten(true); } - -export function interposeFactory(iterable, separator) { - var interposedSequence = makeSequence(iterable); - interposedSequence.size = iterable.size && iterable.size * 2 -1; - interposedSequence.__iterateUncached = function(fn, reverse) { - var iterations = 0; - iterable.__iterate((v, k) => - (!iterations || fn(separator, iterations++, this) !== false) && - fn(v, iterations++, this) !== false, +export function interposeFactory(collection, separator) { + const interposedSequence = makeSequence(collection); + interposedSequence.size = collection.size && collection.size * 2 - 1; + interposedSequence.__iterateUncached = function (fn, reverse) { + let iterations = 0; + collection.__iterate( + (v) => + (!iterations || fn(separator, iterations++, this) !== false) && + fn(v, iterations++, this) !== false, reverse ); return iterations; }; - interposedSequence.__iteratorUncached = function(type, reverse) { - var iterator = iterable.__iterator(ITERATE_VALUES, reverse); - var iterations = 0; - var step; + interposedSequence.__iteratorUncached = function (type, reverse) { + const iterator = collection.__iterator(ITERATE_VALUES, reverse); + let iterations = 0; + let step; return new Iterator(() => { if (!step || iterations % 2) { step = iterator.next(); @@ -675,63 +807,74 @@ export function interposeFactory(iterable, separator) { return step; } } - return iterations % 2 ? - iteratorValue(type, iterations++, separator) : - iteratorValue(type, iterations++, step.value, step); + return iterations % 2 + ? iteratorValue(type, iterations++, separator) + : iteratorValue(type, iterations++, step.value, step); }); }; return interposedSequence; } - -export function sortFactory(iterable, comparator, mapper) { +export function sortFactory(collection, comparator, mapper) { if (!comparator) { comparator = defaultComparator; } - var isKeyedIterable = isKeyed(iterable); - var index = 0; - var entries = iterable.toSeq().map( - (v, k) => [k, v, index++, mapper ? mapper(v, k, iterable) : v] - ).toArray(); - entries.sort((a, b) => comparator(a[3], b[3]) || a[2] - b[2]).forEach( - isKeyedIterable ? - (v, i) => { entries[i].length = 2; } : - (v, i) => { entries[i] = v[1]; } - ); - return isKeyedIterable ? KeyedSeq(entries) : - isIndexed(iterable) ? IndexedSeq(entries) : - SetSeq(entries); + const isKeyedCollection = isKeyed(collection); + let index = 0; + const entries = collection + .toSeq() + .map((v, k) => [k, v, index++, mapper ? mapper(v, k, collection) : v]) + .valueSeq() + .toArray(); + entries + .sort((a, b) => comparator(a[3], b[3]) || a[2] - b[2]) + .forEach( + isKeyedCollection + ? (v, i) => { + entries[i].length = 2; + } + : (v, i) => { + entries[i] = v[1]; + } + ); + return isKeyedCollection + ? KeyedSeq(entries) + : isIndexed(collection) + ? IndexedSeq(entries) + : SetSeq(entries); } - -export function maxFactory(iterable, comparator, mapper) { +export function maxFactory(collection, comparator, mapper) { if (!comparator) { comparator = defaultComparator; } if (mapper) { - var entry = iterable.toSeq() - .map((v, k) => [v, mapper(v, k, iterable)]) - .reduce((a, b) => maxCompare(comparator, a[1], b[1]) ? b : a); + const entry = collection + .toSeq() + .map((v, k) => [v, mapper(v, k, collection)]) + .reduce((a, b) => (maxCompare(comparator, a[1], b[1]) ? b : a)); return entry && entry[0]; - } else { - return iterable.reduce((a, b) => maxCompare(comparator, a, b) ? b : a); } + return collection.reduce((a, b) => (maxCompare(comparator, a, b) ? b : a)); } function maxCompare(comparator, a, b) { - var comp = comparator(b, a); + const comp = comparator(b, a); // b is considered the new max if the comparator declares them equal, but // they are not equal and b is in fact a nullish value. - return (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || comp > 0; + return ( + (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || + comp > 0 + ); } - -export function zipWithFactory(keyIter, zipper, iters) { - var zipSequence = makeSequence(keyIter); - zipSequence.size = new ArraySeq(iters).map(i => i.size).min(); +export function zipWithFactory(keyIter, zipper, iters, zipAll) { + const zipSequence = makeSequence(keyIter); + const sizes = new ArraySeq(iters).map((i) => i.size); + zipSequence.size = zipAll ? sizes.max() : sizes.min(); // Note: this a generic base implementation of __iterate in terms of // __iterator which may be more generically useful in the future. - zipSequence.__iterate = function(fn, reverse) { + zipSequence.__iterate = function (fn, reverse) { /* generic: var iterator = this.__iterator(ITERATE_ENTRIES, reverse); var step; @@ -745,9 +888,9 @@ export function zipWithFactory(keyIter, zipper, iters) { return iterations; */ // indexed: - var iterator = this.__iterator(ITERATE_VALUES, reverse); - var step; - var iterations = 0; + const iterator = this.__iterator(ITERATE_VALUES, reverse); + let step; + let iterations = 0; while (!(step = iterator.next()).done) { if (fn(step.value, iterations++, this) === false) { break; @@ -755,17 +898,19 @@ export function zipWithFactory(keyIter, zipper, iters) { } return iterations; }; - zipSequence.__iteratorUncached = function(type, reverse) { - var iterators = iters.map(i => - (i = Iterable(i), getIterator(reverse ? i.reverse() : i)) + zipSequence.__iteratorUncached = function (type, reverse) { + const iterators = iters.map( + (i) => ((i = Collection(i)), getIterator(reverse ? i.reverse() : i)) ); - var iterations = 0; - var isDone = false; + let iterations = 0; + let isDone = false; return new Iterator(() => { - var steps; + let steps; if (!isDone) { - steps = iterators.map(i => i.next()); - isDone = steps.some(s => s.done); + steps = iterators.map((i) => i.next()); + isDone = zipAll + ? steps.every((s) => s.done) + : steps.some((s) => s.done); } if (isDone) { return iteratorDone(); @@ -773,18 +918,20 @@ export function zipWithFactory(keyIter, zipper, iters) { return iteratorValue( type, iterations++, - zipper.apply(null, steps.map(s => s.value)) + zipper.apply( + null, + steps.map((s) => s.value) + ) ); }); }; - return zipSequence + return zipSequence; } - // #pragma Helper Functions export function reify(iter, seq) { - return isSeq(iter) ? seq : iter.constructor(seq); + return iter === seq ? iter : isSeq(iter) ? seq : iter.constructor(seq); } function validateEntry(entry) { @@ -793,23 +940,21 @@ function validateEntry(entry) { } } -function resolveSize(iter) { - assertNotInfinite(iter.size); - return ensureSize(iter); -} - -function iterableClass(iterable) { - return isKeyed(iterable) ? KeyedIterable : - isIndexed(iterable) ? IndexedIterable : - SetIterable; +function collectionClass(collection) { + return isKeyed(collection) + ? KeyedCollection + : isIndexed(collection) + ? IndexedCollection + : SetCollection; } -function makeSequence(iterable) { +function makeSequence(collection) { return Object.create( - ( - isKeyed(iterable) ? KeyedSeq : - isIndexed(iterable) ? IndexedSeq : - SetSeq + (isKeyed(collection) + ? KeyedSeq + : isIndexed(collection) + ? IndexedSeq + : SetSeq ).prototype ); } @@ -819,11 +964,22 @@ function cacheResultThrough() { this._iter.cacheResult(); this.size = this._iter.size; return this; - } else { - return Seq.prototype.cacheResult.call(this); } + return Seq.prototype.cacheResult.call(this); } function defaultComparator(a, b) { + if (a === undefined && b === undefined) { + return 0; + } + + if (a === undefined) { + return 1; + } + + if (b === undefined) { + return -1; + } + return a > b ? 1 : a < b ? -1 : 0; } diff --git a/src/OrderedMap.js b/src/OrderedMap.js index 2351a70c93..c6867b6c83 100644 --- a/src/OrderedMap.js +++ b/src/OrderedMap.js @@ -1,31 +1,25 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { KeyedIterable, IS_ORDERED_SENTINEL, isOrdered } from './Iterable' -import { Map, isMap, emptyMap } from './Map' -import { emptyList } from './List' -import { DELETE, NOT_SET, SIZE } from './TrieUtils' -import assertNotInfinite from './utils/assertNotInfinite' - +import { KeyedCollection } from './Collection'; +import { IS_ORDERED_SYMBOL } from './predicates/isOrdered'; +import { isOrderedMap } from './predicates/isOrderedMap'; +import { Map, emptyMap } from './Map'; +import { emptyList } from './List'; +import { DELETE, NOT_SET, SIZE } from './TrieUtils'; +import assertNotInfinite from './utils/assertNotInfinite'; export class OrderedMap extends Map { - // @pragma Construction constructor(value) { - return value === null || value === undefined ? emptyOrderedMap() : - isOrderedMap(value) ? value : - emptyOrderedMap().withMutations(map => { - var iter = KeyedIterable(value); - assertNotInfinite(iter.size); - iter.forEach((v, k) => map.set(k, v)); - }); + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptyOrderedMap() + : isOrderedMap(value) + ? value + : emptyOrderedMap().withMutations((map) => { + const iter = KeyedCollection(value); + assertNotInfinite(iter.size); + iter.forEach((v, k) => map.set(k, v)); + }); } static of(/*...values*/) { @@ -39,7 +33,7 @@ export class OrderedMap extends Map { // @pragma Access get(k, notSetValue) { - var index = this._map.get(k); + const index = this._map.get(k); return index !== undefined ? this._list.get(index)[1] : notSetValue; } @@ -53,6 +47,7 @@ export class OrderedMap extends Map { this.size = 0; this._map.clear(); this._list.clear(); + this.__altered = true; return this; } return emptyOrderedMap(); @@ -66,13 +61,9 @@ export class OrderedMap extends Map { return updateOrderedMap(this, k, NOT_SET); } - wasAltered() { - return this._map.wasAltered() || this._list.wasAltered(); - } - __iterate(fn, reverse) { return this._list.__iterate( - entry => entry && fn(entry[1], entry[0], this), + (entry) => entry && fn(entry[1], entry[0], this), reverse ); } @@ -85,10 +76,14 @@ export class OrderedMap extends Map { if (ownerID === this.__ownerID) { return this; } - var newMap = this._map.__ensureOwner(ownerID); - var newList = this._list.__ensureOwner(ownerID); + const newMap = this._map.__ensureOwner(ownerID); + const newList = this._list.__ensureOwner(ownerID); if (!ownerID) { + if (this.size === 0) { + return emptyOrderedMap(); + } this.__ownerID = ownerID; + this.__altered = false; this._map = newMap; this._list = newList; return this; @@ -97,46 +92,49 @@ export class OrderedMap extends Map { } } -function isOrderedMap(maybeOrderedMap) { - return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap); -} - OrderedMap.isOrderedMap = isOrderedMap; -OrderedMap.prototype[IS_ORDERED_SENTINEL] = true; +OrderedMap.prototype[IS_ORDERED_SYMBOL] = true; OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove; - - function makeOrderedMap(map, list, ownerID, hash) { - var omap = Object.create(OrderedMap.prototype); + const omap = Object.create(OrderedMap.prototype); omap.size = map ? map.size : 0; omap._map = map; omap._list = list; omap.__ownerID = ownerID; omap.__hash = hash; + omap.__altered = false; return omap; } -var EMPTY_ORDERED_MAP; +let EMPTY_ORDERED_MAP; export function emptyOrderedMap() { - return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList())); + return ( + EMPTY_ORDERED_MAP || + (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList())) + ); } function updateOrderedMap(omap, k, v) { - var map = omap._map; - var list = omap._list; - var i = map.get(k); - var has = i !== undefined; - var newMap; - var newList; - if (v === NOT_SET) { // removed + const map = omap._map; + const list = omap._list; + const i = map.get(k); + const has = i !== undefined; + let newMap; + let newList; + if (v === NOT_SET) { + // removed if (!has) { return omap; } if (list.size >= SIZE && list.size >= map.size * 2) { newList = list.filter((entry, idx) => entry !== undefined && i !== idx); - newMap = newList.toKeyedSeq().map(entry => entry[0]).flip().toMap(); + newMap = newList + .toKeyedSeq() + .map((entry) => entry[0]) + .flip() + .toMap(); if (omap.__ownerID) { newMap.__ownerID = newList.__ownerID = omap.__ownerID; } @@ -144,23 +142,22 @@ function updateOrderedMap(omap, k, v) { newMap = map.remove(k); newList = i === list.size - 1 ? list.pop() : list.set(i, undefined); } - } else { - if (has) { - if (v === list.get(i)[1]) { - return omap; - } - newMap = map; - newList = list.set(i, [k, v]); - } else { - newMap = map.set(k, list.size); - newList = list.set(list.size, [k, v]); + } else if (has) { + if (v === list.get(i)[1]) { + return omap; } + newMap = map; + newList = list.set(i, [k, v]); + } else { + newMap = map.set(k, list.size); + newList = list.set(list.size, [k, v]); } if (omap.__ownerID) { omap.size = newMap.size; omap._map = newMap; omap._list = newList; omap.__hash = undefined; + omap.__altered = true; return omap; } return makeOrderedMap(newMap, newList); diff --git a/src/OrderedSet.js b/src/OrderedSet.js index 01df6bdcff..98da36416f 100644 --- a/src/OrderedSet.js +++ b/src/OrderedSet.js @@ -1,30 +1,25 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { SetIterable, KeyedIterable, IS_ORDERED_SENTINEL, isOrdered } from './Iterable' -import { Set, isSet } from './Set' -import { emptyOrderedMap } from './OrderedMap' -import assertNotInfinite from './utils/assertNotInfinite' - +import { SetCollection, KeyedCollection } from './Collection'; +import { IS_ORDERED_SYMBOL } from './predicates/isOrdered'; +import { isOrderedSet } from './predicates/isOrderedSet'; +import { IndexedCollectionPrototype } from './CollectionImpl'; +import { Set } from './Set'; +import { emptyOrderedMap } from './OrderedMap'; +import assertNotInfinite from './utils/assertNotInfinite'; export class OrderedSet extends Set { - // @pragma Construction constructor(value) { - return value === null || value === undefined ? emptyOrderedSet() : - isOrderedSet(value) ? value : - emptyOrderedSet().withMutations(set => { - var iter = SetIterable(value); - assertNotInfinite(iter.size); - iter.forEach(v => set.add(v)); - }); + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptyOrderedSet() + : isOrderedSet(value) + ? value + : emptyOrderedSet().withMutations((set) => { + const iter = SetCollection(value); + assertNotInfinite(iter.size); + iter.forEach((v) => set.add(v)); + }); } static of(/*...values*/) { @@ -32,7 +27,7 @@ export class OrderedSet extends Set { } static fromKeys(value) { - return this(KeyedIterable(value).keySeq()); + return this(KeyedCollection(value).keySeq()); } toString() { @@ -40,27 +35,28 @@ export class OrderedSet extends Set { } } -function isOrderedSet(maybeOrderedSet) { - return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet); -} - OrderedSet.isOrderedSet = isOrderedSet; -var OrderedSetPrototype = OrderedSet.prototype; -OrderedSetPrototype[IS_ORDERED_SENTINEL] = true; +const OrderedSetPrototype = OrderedSet.prototype; +OrderedSetPrototype[IS_ORDERED_SYMBOL] = true; +OrderedSetPrototype.zip = IndexedCollectionPrototype.zip; +OrderedSetPrototype.zipWith = IndexedCollectionPrototype.zipWith; +OrderedSetPrototype.zipAll = IndexedCollectionPrototype.zipAll; OrderedSetPrototype.__empty = emptyOrderedSet; OrderedSetPrototype.__make = makeOrderedSet; function makeOrderedSet(map, ownerID) { - var set = Object.create(OrderedSetPrototype); + const set = Object.create(OrderedSetPrototype); set.size = map ? map.size : 0; set._map = map; set.__ownerID = ownerID; return set; } -var EMPTY_ORDERED_SET; +let EMPTY_ORDERED_SET; function emptyOrderedSet() { - return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap())); + return ( + EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap())) + ); } diff --git a/src/PairSorting.js b/src/PairSorting.js new file mode 100644 index 0000000000..a8d6e4e240 --- /dev/null +++ b/src/PairSorting.js @@ -0,0 +1,4 @@ +export const PairSorting = { + LeftThenRight: -1, + RightThenLeft: +1, +}; diff --git a/src/Range.js b/src/Range.js index ecb42e489b..a7ac912aed 100644 --- a/src/Range.js +++ b/src/Range.js @@ -1,19 +1,9 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { wrapIndex, wholeSlice, resolveBegin, resolveEnd } from './TrieUtils' -import { IndexedSeq } from './Seq' -import { Iterator, iteratorValue, iteratorDone } from './Iterator' - -import invariant from './utils/invariant' -import deepEqual from './utils/deepEqual' +import { wrapIndex, wholeSlice, resolveBegin, resolveEnd } from './TrieUtils'; +import { IndexedSeq } from './Seq'; +import { Iterator, iteratorValue, iteratorDone } from './Iterator'; +import invariant from './utils/invariant'; +import deepEqual from './utils/deepEqual'; /** * Returns a lazy seq of nums from start (inclusive) to end @@ -21,17 +11,22 @@ import deepEqual from './utils/deepEqual' * infinity. When start is equal to end, returns empty list. */ export class Range extends IndexedSeq { - - constructor(start, end, step) { + constructor(start, end, step = 1) { if (!(this instanceof Range)) { + // eslint-disable-next-line no-constructor-return return new Range(start, end, step); } invariant(step !== 0, 'Cannot step a Range by 0'); - start = start || 0; - if (end === undefined) { - end = Infinity; - } - step = step === undefined ? 1 : Math.abs(step); + invariant( + start !== undefined, + 'You must define a start value when using Range' + ); + invariant( + end !== undefined, + 'You must define an end value when using Range' + ); + + step = Math.abs(step); if (end < start) { step = -step; } @@ -41,33 +36,33 @@ export class Range extends IndexedSeq { this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1); if (this.size === 0) { if (EMPTY_RANGE) { + // eslint-disable-next-line no-constructor-return return EMPTY_RANGE; } + // eslint-disable-next-line @typescript-eslint/no-this-alias EMPTY_RANGE = this; } } toString() { - if (this.size === 0) { - return 'Range []'; - } - return 'Range [ ' + - this._start + '...' + this._end + - (this._step > 1 ? ' by ' + this._step : '') + - ' ]'; + return this.size === 0 + ? 'Range []' + : `Range [ ${this._start}...${this._end}${this._step !== 1 ? ' by ' + this._step : ''} ]`; } get(index, notSetValue) { - return this.has(index) ? - this._start + wrapIndex(this, index) * this._step : - notSetValue; + return this.has(index) + ? this._start + wrapIndex(this, index) * this._step + : notSetValue; } includes(searchValue) { - var possibleIndex = (searchValue - this._start) / this._step; - return possibleIndex >= 0 && + const possibleIndex = (searchValue - this._start) / this._step; + return ( + possibleIndex >= 0 && possibleIndex < this.size && - possibleIndex === Math.floor(possibleIndex); + possibleIndex === Math.floor(possibleIndex) + ); } slice(begin, end) { @@ -79,15 +74,19 @@ export class Range extends IndexedSeq { if (end <= begin) { return new Range(0, 0); } - return new Range(this.get(begin, this._end), this.get(end, this._end), this._step); + return new Range( + this.get(begin, this._end), + this.get(end, this._end), + this._step + ); } indexOf(searchValue) { - var offsetValue = searchValue - this._start; + const offsetValue = searchValue - this._start; if (offsetValue % this._step === 0) { - var index = offsetValue / this._step; + const index = offsetValue / this._step; if (index >= 0 && index < this.size) { - return index + return index; } } return -1; @@ -98,37 +97,41 @@ export class Range extends IndexedSeq { } __iterate(fn, reverse) { - var maxIndex = this.size - 1; - var step = this._step; - var value = reverse ? this._start + maxIndex * step : this._start; - for (var ii = 0; ii <= maxIndex; ii++) { - if (fn(value, ii, this) === false) { - return ii + 1; + const size = this.size; + const step = this._step; + let value = reverse ? this._start + (size - 1) * step : this._start; + let i = 0; + while (i !== size) { + if (fn(value, reverse ? size - ++i : i++, this) === false) { + break; } value += reverse ? -step : step; } - return ii; + return i; } __iterator(type, reverse) { - var maxIndex = this.size - 1; - var step = this._step; - var value = reverse ? this._start + maxIndex * step : this._start; - var ii = 0; + const size = this.size; + const step = this._step; + let value = reverse ? this._start + (size - 1) * step : this._start; + let i = 0; return new Iterator(() => { - var v = value; + if (i === size) { + return iteratorDone(); + } + const v = value; value += reverse ? -step : step; - return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v); + return iteratorValue(type, reverse ? size - ++i : i++, v); }); } equals(other) { - return other instanceof Range ? - this._start === other._start && - this._end === other._end && - this._step === other._step : - deepEqual(this, other); + return other instanceof Range + ? this._start === other._start && + this._end === other._end && + this._step === other._step + : deepEqual(this, other); } } -var EMPTY_RANGE; +let EMPTY_RANGE; diff --git a/src/Record.js b/src/Record.js index 06f9948b3f..89100a6410 100644 --- a/src/Record.js +++ b/src/Record.js @@ -1,26 +1,55 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +import { toJS } from './toJS'; +import { KeyedCollection } from './Collection'; +import { keyedSeqFromValue } from './Seq'; +import { List } from './List'; +import { ITERATE_ENTRIES, ITERATOR_SYMBOL } from './Iterator'; +import { isRecord, IS_RECORD_SYMBOL } from './predicates/isRecord'; +import { CollectionPrototype } from './CollectionImpl'; +import { DELETE } from './TrieUtils'; +import { getIn } from './methods/getIn'; +import { setIn } from './methods/setIn'; +import { deleteIn } from './methods/deleteIn'; +import { update } from './methods/update'; +import { updateIn } from './methods/updateIn'; +import { merge, mergeWith } from './methods/merge'; +import { mergeDeep, mergeDeepWith } from './methods/mergeDeep'; +import { mergeIn } from './methods/mergeIn'; +import { mergeDeepIn } from './methods/mergeDeepIn'; +import { withMutations } from './methods/withMutations'; +import { asMutable } from './methods/asMutable'; +import { asImmutable } from './methods/asImmutable'; -import { KeyedIterable } from './Iterable' -import { KeyedCollection } from './Collection' -import { Map, MapPrototype, emptyMap } from './Map' -import { DELETE } from './TrieUtils' +import invariant from './utils/invariant'; +import quoteString from './utils/quoteString'; +import { isImmutable } from './predicates/isImmutable'; -import invariant from './utils/invariant' +function throwOnInvalidDefaultValues(defaultValues) { + if (isRecord(defaultValues)) { + throw new Error( + 'Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.' + ); + } + if (isImmutable(defaultValues)) { + throw new Error( + 'Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.' + ); + } -export class Record extends KeyedCollection { + if (defaultValues === null || typeof defaultValues !== 'object') { + throw new Error( + 'Can not call `Record` with a non-object as default values. Use a plain javascript object instead.' + ); + } +} +export class Record { constructor(defaultValues, name) { - var hasInitialized; + let hasInitialized; + + throwOnInvalidDefaultValues(defaultValues); - var RecordType = function Record(values) { + const RecordType = function Record(values) { if (values instanceof RecordType) { return values; } @@ -29,144 +58,212 @@ export class Record extends KeyedCollection { } if (!hasInitialized) { hasInitialized = true; - var keys = Object.keys(defaultValues); - setProps(RecordTypePrototype, keys); - RecordTypePrototype.size = keys.length; + const keys = Object.keys(defaultValues); + const indices = (RecordTypePrototype._indices = {}); + // Deprecated: left to attempt not to break any external code which + // relies on a ._name property existing on record instances. + // Use Record.getDescriptiveName() instead RecordTypePrototype._name = name; RecordTypePrototype._keys = keys; RecordTypePrototype._defaultValues = defaultValues; + for (let i = 0; i < keys.length; i++) { + const propName = keys[i]; + indices[propName] = i; + if (RecordTypePrototype[propName]) { + /* eslint-disable no-console */ + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + typeof console === 'object' && + console.warn && + console.warn( + 'Cannot define ' + + recordName(this) + + ' with property "' + + propName + + '" since that property name is part of the Record API.' + ); + /* eslint-enable no-console */ + } else { + setProp(RecordTypePrototype, propName); + } + } } - this._map = Map(values); + this.__ownerID = undefined; + this._values = List().withMutations((l) => { + l.setSize(this._keys.length); + KeyedCollection(values).forEach((v, k) => { + l.set(this._indices[k], v === this._defaultValues[k] ? undefined : v); + }); + }); + return this; }; - var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype); + const RecordTypePrototype = (RecordType.prototype = + Object.create(RecordPrototype)); RecordTypePrototype.constructor = RecordType; + if (name) { + RecordType.displayName = name; + } + + // eslint-disable-next-line no-constructor-return return RecordType; } toString() { - return this.__toString(recordName(this) + ' {', '}'); + let str = recordName(this) + ' { '; + const keys = this._keys; + let k; + for (let i = 0, l = keys.length; i !== l; i++) { + k = keys[i]; + str += (i ? ', ' : '') + k + ': ' + quoteString(this.get(k)); + } + return str + ' }'; + } + + equals(other) { + return ( + this === other || + (isRecord(other) && recordSeq(this).equals(recordSeq(other))) + ); + } + + hashCode() { + return recordSeq(this).hashCode(); } // @pragma Access has(k) { - return this._defaultValues.hasOwnProperty(k); + return this._indices.hasOwnProperty(k); } get(k, notSetValue) { if (!this.has(k)) { return notSetValue; } - var defaultVal = this._defaultValues[k]; - return this._map ? this._map.get(k, defaultVal) : defaultVal; + const index = this._indices[k]; + const value = this._values.get(index); + return value === undefined ? this._defaultValues[k] : value; } // @pragma Modification - clear() { - if (this.__ownerID) { - this._map && this._map.clear(); - return this; - } - var RecordType = this.constructor; - return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap())); - } - set(k, v) { - if (!this.has(k)) { - throw new Error('Cannot set unknown key "' + k + '" on ' + recordName(this)); - } - var newMap = this._map && this._map.set(k, v); - if (this.__ownerID || newMap === this._map) { - return this; + if (this.has(k)) { + const newValues = this._values.set( + this._indices[k], + v === this._defaultValues[k] ? undefined : v + ); + if (newValues !== this._values && !this.__ownerID) { + return makeRecord(this, newValues); + } } - return makeRecord(this, newMap); + return this; } remove(k) { - if (!this.has(k)) { - return this; - } - var newMap = this._map && this._map.remove(k); - if (this.__ownerID || newMap === this._map) { - return this; - } - return makeRecord(this, newMap); + return this.set(k); + } + + clear() { + const newValues = this._values.clear().setSize(this._keys.length); + + return this.__ownerID ? this : makeRecord(this, newValues); } wasAltered() { - return this._map.wasAltered(); + return this._values.wasAltered(); + } + + toSeq() { + return recordSeq(this); + } + + toJS() { + return toJS(this); + } + + entries() { + return this.__iterator(ITERATE_ENTRIES); } __iterator(type, reverse) { - return KeyedIterable(this._defaultValues).map((_, k) => this.get(k)).__iterator(type, reverse); + return recordSeq(this).__iterator(type, reverse); } __iterate(fn, reverse) { - return KeyedIterable(this._defaultValues).map((_, k) => this.get(k)).__iterate(fn, reverse); + return recordSeq(this).__iterate(fn, reverse); } __ensureOwner(ownerID) { if (ownerID === this.__ownerID) { return this; } - var newMap = this._map && this._map.__ensureOwner(ownerID); + const newValues = this._values.__ensureOwner(ownerID); if (!ownerID) { this.__ownerID = ownerID; - this._map = newMap; + this._values = newValues; return this; } - return makeRecord(this, newMap, ownerID); + return makeRecord(this, newValues, ownerID); } } -var RecordPrototype = Record.prototype; +Record.isRecord = isRecord; +Record.getDescriptiveName = recordName; +const RecordPrototype = Record.prototype; +RecordPrototype[IS_RECORD_SYMBOL] = true; RecordPrototype[DELETE] = RecordPrototype.remove; -RecordPrototype.deleteIn = -RecordPrototype.removeIn = MapPrototype.removeIn; -RecordPrototype.merge = MapPrototype.merge; -RecordPrototype.mergeWith = MapPrototype.mergeWith; -RecordPrototype.mergeIn = MapPrototype.mergeIn; -RecordPrototype.mergeDeep = MapPrototype.mergeDeep; -RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith; -RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn; -RecordPrototype.setIn = MapPrototype.setIn; -RecordPrototype.update = MapPrototype.update; -RecordPrototype.updateIn = MapPrototype.updateIn; -RecordPrototype.withMutations = MapPrototype.withMutations; -RecordPrototype.asMutable = MapPrototype.asMutable; -RecordPrototype.asImmutable = MapPrototype.asImmutable; - - -function makeRecord(likeRecord, map, ownerID) { - var record = Object.create(Object.getPrototypeOf(likeRecord)); - record._map = map; +RecordPrototype.deleteIn = RecordPrototype.removeIn = deleteIn; +RecordPrototype.getIn = getIn; +RecordPrototype.hasIn = CollectionPrototype.hasIn; +RecordPrototype.merge = merge; +RecordPrototype.mergeWith = mergeWith; +RecordPrototype.mergeIn = mergeIn; +RecordPrototype.mergeDeep = mergeDeep; +RecordPrototype.mergeDeepWith = mergeDeepWith; +RecordPrototype.mergeDeepIn = mergeDeepIn; +RecordPrototype.setIn = setIn; +RecordPrototype.update = update; +RecordPrototype.updateIn = updateIn; +RecordPrototype.withMutations = withMutations; +RecordPrototype.asMutable = asMutable; +RecordPrototype.asImmutable = asImmutable; +RecordPrototype[ITERATOR_SYMBOL] = RecordPrototype.entries; +RecordPrototype.toJSON = RecordPrototype.toObject = + CollectionPrototype.toObject; +RecordPrototype.inspect = RecordPrototype.toSource = function () { + return this.toString(); +}; + +function makeRecord(likeRecord, values, ownerID) { + const record = Object.create(Object.getPrototypeOf(likeRecord)); + record._values = values; record.__ownerID = ownerID; return record; } function recordName(record) { - return record._name || record.constructor.name || 'Record'; + return record.constructor.displayName || record.constructor.name || 'Record'; +} + +function recordSeq(record) { + return keyedSeqFromValue(record._keys.map((k) => [k, record.get(k)])); } -function setProps(prototype, names) { +function setProp(prototype, name) { try { - names.forEach(setProp.bind(undefined, prototype)); + Object.defineProperty(prototype, name, { + get: function () { + return this.get(name); + }, + set: function (value) { + invariant(this.__ownerID, 'Cannot set on an immutable record.'); + this.set(name, value); + }, + }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars -- TODO enable eslint here } catch (error) { // Object.defineProperty failed. Probably IE8. } } - -function setProp(prototype, name) { - Object.defineProperty(prototype, name, { - get: function() { - return this.get(name); - }, - set: function(value) { - invariant(this.__ownerID, 'Cannot set on an immutable record.'); - this.set(name, value); - } - }); -} diff --git a/src/Repeat.js b/src/Repeat.js index 6135a1ec79..0fb106156c 100644 --- a/src/Repeat.js +++ b/src/Repeat.js @@ -1,36 +1,28 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { wholeSlice, resolveBegin, resolveEnd } from './TrieUtils' -import { IndexedSeq } from './Seq' -import { is } from './is' -import { Iterator, iteratorValue, iteratorDone } from './Iterator' - -import deepEqual from './utils/deepEqual' +import { wholeSlice, resolveBegin, resolveEnd } from './TrieUtils'; +import { IndexedSeq } from './Seq'; +import { is } from './is'; +import { Iterator, iteratorValue, iteratorDone } from './Iterator'; +import deepEqual from './utils/deepEqual'; /** * Returns a lazy Seq of `value` repeated `times` times. When `times` is * undefined, returns an infinite sequence of `value`. */ export class Repeat extends IndexedSeq { - constructor(value, times) { if (!(this instanceof Repeat)) { + // eslint-disable-next-line no-constructor-return return new Repeat(value, times); } this._value = value; this.size = times === undefined ? Infinity : Math.max(0, times); if (this.size === 0) { if (EMPTY_REPEAT) { + // eslint-disable-next-line no-constructor-return return EMPTY_REPEAT; } + // eslint-disable-next-line @typescript-eslint/no-this-alias EMPTY_REPEAT = this; } } @@ -51,9 +43,13 @@ export class Repeat extends IndexedSeq { } slice(begin, end) { - var size = this.size; - return wholeSlice(begin, end, size) ? this : - new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size)); + const size = this.size; + return wholeSlice(begin, end, size) + ? this + : new Repeat( + this._value, + resolveEnd(end, size) - resolveBegin(begin, size) + ); } reverse() { @@ -75,26 +71,31 @@ export class Repeat extends IndexedSeq { } __iterate(fn, reverse) { - for (var ii = 0; ii < this.size; ii++) { - if (fn(this._value, ii, this) === false) { - return ii + 1; + const size = this.size; + let i = 0; + while (i !== size) { + if (fn(this._value, reverse ? size - ++i : i++, this) === false) { + break; } } - return ii; + return i; } __iterator(type, reverse) { - var ii = 0; + const size = this.size; + let i = 0; return new Iterator(() => - ii < this.size ? iteratorValue(type, ii++, this._value) : iteratorDone() + i === size + ? iteratorDone() + : iteratorValue(type, reverse ? size - ++i : i++, this._value) ); } equals(other) { - return other instanceof Repeat ? - is(this._value, other._value) : - deepEqual(other); + return other instanceof Repeat + ? is(this._value, other._value) + : deepEqual(this, other); } } -var EMPTY_REPEAT; +let EMPTY_REPEAT; diff --git a/src/Seq.js b/src/Seq.js index e8b313d2d5..fd2a1dea58 100644 --- a/src/Seq.js +++ b/src/Seq.js @@ -1,27 +1,34 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { wrapIndex } from './TrieUtils' -import { isIterable, isKeyed, Iterable, IS_ORDERED_SENTINEL } from './Iterable' -import { Iterator, iteratorValue, iteratorDone, hasIterator, isIterator, getIterator } from './Iterator' - -import isArrayLike from './utils/isArrayLike' - - -export class Seq extends Iterable { +import { wrapIndex } from './TrieUtils'; +import { Collection } from './Collection'; +import { IS_SEQ_SYMBOL, isSeq } from './predicates/isSeq'; +import { isImmutable } from './predicates/isImmutable'; +import { isCollection } from './predicates/isCollection'; +import { isKeyed } from './predicates/isKeyed'; +import { isAssociative } from './predicates/isAssociative'; +import { isRecord } from './predicates/isRecord'; +import { IS_ORDERED_SYMBOL } from './predicates/isOrdered'; +import { + Iterator, + iteratorValue, + iteratorDone, + hasIterator, + isIterator, + getIterator, + isEntriesIterable, + isKeysIterable, +} from './Iterator'; + +import hasOwnProperty from './utils/hasOwnProperty'; +import isArrayLike from './utils/isArrayLike'; + +export class Seq extends Collection { constructor(value) { - return value === null || value === undefined ? emptySequence() : - isIterable(value) ? value.toSeq() : seqFromValue(value); - } - - static of(/*...values*/) { - return Seq(arguments); + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptySequence() + : isImmutable(value) + ? value.toSeq() + : seqFromValue(value); } toSeq() { @@ -43,24 +50,52 @@ export class Seq extends Iterable { // abstract __iterateUncached(fn, reverse) __iterate(fn, reverse) { - return seqIterate(this, fn, reverse, true); + const cache = this._cache; + if (cache) { + const size = cache.length; + let i = 0; + while (i !== size) { + const entry = cache[reverse ? size - ++i : i++]; + if (fn(entry[1], entry[0], this) === false) { + break; + } + } + return i; + } + return this.__iterateUncached(fn, reverse); } // abstract __iteratorUncached(type, reverse) __iterator(type, reverse) { - return seqIterator(this, type, reverse, true); + const cache = this._cache; + if (cache) { + const size = cache.length; + let i = 0; + return new Iterator(() => { + if (i === size) { + return iteratorDone(); + } + const entry = cache[reverse ? size - ++i : i++]; + return iteratorValue(type, entry[0], entry[1]); + }); + } + return this.__iteratorUncached(type, reverse); } } - export class KeyedSeq extends Seq { constructor(value) { - return value === null || value === undefined ? - emptySequence().toKeyedSeq() : - isIterable(value) ? - (isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) : - keyedSeqFromValue(value); + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptySequence().toKeyedSeq() + : isCollection(value) + ? isKeyed(value) + ? value.toSeq() + : value.fromEntrySeq() + : isRecord(value) + ? value.toSeq() + : keyedSeqFromValue(value); } toKeyedSeq() { @@ -68,12 +103,18 @@ export class KeyedSeq extends Seq { } } - export class IndexedSeq extends Seq { constructor(value) { - return value === null || value === undefined ? emptySequence() : - !isIterable(value) ? indexedSeqFromValue(value) : - isKeyed(value) ? value.entrySeq() : value.toIndexedSeq(); + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptySequence() + : isCollection(value) + ? isKeyed(value) + ? value.entrySeq() + : value.toIndexedSeq() + : isRecord(value) + ? value.toSeq().entrySeq() + : indexedSeqFromValue(value); } static of(/*...values*/) { @@ -87,23 +128,13 @@ export class IndexedSeq extends Seq { toString() { return this.__toString('Seq [', ']'); } - - __iterate(fn, reverse) { - return seqIterate(this, fn, reverse, false); - } - - __iterator(type, reverse) { - return seqIterator(this, type, reverse, false); - } } - export class SetSeq extends Seq { constructor(value) { + // eslint-disable-next-line no-constructor-return return ( - value === null || value === undefined ? emptySequence() : - !isIterable(value) ? indexedSeqFromValue(value) : - isKeyed(value) ? value.entrySeq() : value + isCollection(value) && !isAssociative(value) ? value : IndexedSeq(value) ).toSetSeq(); } @@ -116,17 +147,12 @@ export class SetSeq extends Seq { } } - Seq.isSeq = isSeq; Seq.Keyed = KeyedSeq; Seq.Set = SetSeq; Seq.Indexed = IndexedSeq; -var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@'; - -Seq.prototype[IS_SEQ_SENTINEL] = true; - - +Seq.prototype[IS_SEQ_SYMBOL] = true; // #pragma Root Sequences @@ -141,32 +167,37 @@ export class ArraySeq extends IndexedSeq { } __iterate(fn, reverse) { - var array = this._array; - var maxIndex = array.length - 1; - for (var ii = 0; ii <= maxIndex; ii++) { - if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) { - return ii + 1; + const array = this._array; + const size = array.length; + let i = 0; + while (i !== size) { + const ii = reverse ? size - ++i : i++; + if (fn(array[ii], ii, this) === false) { + break; } } - return ii; + return i; } __iterator(type, reverse) { - var array = this._array; - var maxIndex = array.length - 1; - var ii = 0; - return new Iterator(() => - ii > maxIndex ? - iteratorDone() : - iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++]) - ); + const array = this._array; + const size = array.length; + let i = 0; + return new Iterator(() => { + if (i === size) { + return iteratorDone(); + } + const ii = reverse ? size - ++i : i++; + return iteratorValue(type, ii, array[ii]); + }); } } - class ObjectSeq extends KeyedSeq { constructor(object) { - var keys = Object.keys(object); + const keys = Object.keys(object).concat( + Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : [] + ); this._object = object; this._keys = keys; this.size = keys.length; @@ -180,53 +211,54 @@ class ObjectSeq extends KeyedSeq { } has(key) { - return this._object.hasOwnProperty(key); + return hasOwnProperty.call(this._object, key); } __iterate(fn, reverse) { - var object = this._object; - var keys = this._keys; - var maxIndex = keys.length - 1; - for (var ii = 0; ii <= maxIndex; ii++) { - var key = keys[reverse ? maxIndex - ii : ii]; + const object = this._object; + const keys = this._keys; + const size = keys.length; + let i = 0; + while (i !== size) { + const key = keys[reverse ? size - ++i : i++]; if (fn(object[key], key, this) === false) { - return ii + 1; + break; } } - return ii; + return i; } __iterator(type, reverse) { - var object = this._object; - var keys = this._keys; - var maxIndex = keys.length - 1; - var ii = 0; + const object = this._object; + const keys = this._keys; + const size = keys.length; + let i = 0; return new Iterator(() => { - var key = keys[reverse ? maxIndex - ii : ii]; - return ii++ > maxIndex ? - iteratorDone() : - iteratorValue(type, key, object[key]); + if (i === size) { + return iteratorDone(); + } + const key = keys[reverse ? size - ++i : i++]; + return iteratorValue(type, key, object[key]); }); } } -ObjectSeq.prototype[IS_ORDERED_SENTINEL] = true; - +ObjectSeq.prototype[IS_ORDERED_SYMBOL] = true; -class IterableSeq extends IndexedSeq { - constructor(iterable) { - this._iterable = iterable; - this.size = iterable.length || iterable.size; +class CollectionSeq extends IndexedSeq { + constructor(collection) { + this._collection = collection; + this.size = collection.length || collection.size; } __iterateUncached(fn, reverse) { if (reverse) { return this.cacheResult().__iterate(fn, reverse); } - var iterable = this._iterable; - var iterator = getIterator(iterable); - var iterations = 0; + const collection = this._collection; + const iterator = getIterator(collection); + let iterations = 0; if (isIterator(iterator)) { - var step; + let step; while (!(step = iterator.next()).done) { if (fn(step.value, iterations++, this) === false) { break; @@ -240,155 +272,72 @@ class IterableSeq extends IndexedSeq { if (reverse) { return this.cacheResult().__iterator(type, reverse); } - var iterable = this._iterable; - var iterator = getIterator(iterable); + const collection = this._collection; + const iterator = getIterator(collection); if (!isIterator(iterator)) { return new Iterator(iteratorDone); } - var iterations = 0; + let iterations = 0; return new Iterator(() => { - var step = iterator.next(); + const step = iterator.next(); return step.done ? step : iteratorValue(type, iterations++, step.value); }); } } - -class IteratorSeq extends IndexedSeq { - constructor(iterator) { - this._iterator = iterator; - this._iteratorCache = []; - } - - __iterateUncached(fn, reverse) { - if (reverse) { - return this.cacheResult().__iterate(fn, reverse); - } - var iterator = this._iterator; - var cache = this._iteratorCache; - var iterations = 0; - while (iterations < cache.length) { - if (fn(cache[iterations], iterations++, this) === false) { - return iterations; - } - } - var step; - while (!(step = iterator.next()).done) { - var val = step.value; - cache[iterations] = val; - if (fn(val, iterations++, this) === false) { - break; - } - } - return iterations; - } - - __iteratorUncached(type, reverse) { - if (reverse) { - return this.cacheResult().__iterator(type, reverse); - } - var iterator = this._iterator; - var cache = this._iteratorCache; - var iterations = 0; - return new Iterator(() => { - if (iterations >= cache.length) { - var step = iterator.next(); - if (step.done) { - return step; - } - cache[iterations] = step.value; - } - return iteratorValue(type, iterations, cache[iterations++]); - }); - } -} - - - // # pragma Helper functions -export function isSeq(maybeSeq) { - return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]); -} - -var EMPTY_SEQ; +let EMPTY_SEQ; function emptySequence() { return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([])); } export function keyedSeqFromValue(value) { - var seq = - Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() : - isIterator(value) ? new IteratorSeq(value).fromEntrySeq() : - hasIterator(value) ? new IterableSeq(value).fromEntrySeq() : - typeof value === 'object' ? new ObjectSeq(value) : - undefined; - if (!seq) { - throw new TypeError( - 'Expected Array or iterable object of [k, v] entries, '+ - 'or keyed object: ' + value - ); + const seq = maybeIndexedSeqFromValue(value); + if (seq) { + return seq.fromEntrySeq(); } - return seq; + if (typeof value === 'object') { + return new ObjectSeq(value); + } + throw new TypeError( + 'Expected Array or collection object of [k, v] entries, or keyed object: ' + + value + ); } export function indexedSeqFromValue(value) { - var seq = maybeIndexedSeqFromValue(value); - if (!seq) { - throw new TypeError( - 'Expected Array or iterable object of values: ' + value - ); + const seq = maybeIndexedSeqFromValue(value); + if (seq) { + return seq; } - return seq; + throw new TypeError( + 'Expected Array or collection object of values: ' + value + ); } function seqFromValue(value) { - var seq = maybeIndexedSeqFromValue(value) || - (typeof value === 'object' && new ObjectSeq(value)); - if (!seq) { - throw new TypeError( - 'Expected Array or iterable object of values, or keyed object: ' + value - ); - } - return seq; -} - -function maybeIndexedSeqFromValue(value) { - return ( - isArrayLike(value) ? new ArraySeq(value) : - isIterator(value) ? new IteratorSeq(value) : - hasIterator(value) ? new IterableSeq(value) : - undefined + const seq = maybeIndexedSeqFromValue(value); + if (seq) { + return isEntriesIterable(value) + ? seq.fromEntrySeq() + : isKeysIterable(value) + ? seq.toSetSeq() + : seq; + } + if (typeof value === 'object') { + return new ObjectSeq(value); + } + throw new TypeError( + 'Expected Array or collection object of values, or keyed object: ' + value ); } -function seqIterate(seq, fn, reverse, useKeys) { - var cache = seq._cache; - if (cache) { - var maxIndex = cache.length - 1; - for (var ii = 0; ii <= maxIndex; ii++) { - var entry = cache[reverse ? maxIndex - ii : ii]; - if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) { - return ii + 1; - } - } - return ii; - } - return seq.__iterateUncached(fn, reverse); -} - -function seqIterator(seq, type, reverse, useKeys) { - var cache = seq._cache; - if (cache) { - var maxIndex = cache.length - 1; - var ii = 0; - return new Iterator(() => { - var entry = cache[reverse ? maxIndex - ii : ii]; - return ii++ > maxIndex ? - iteratorDone() : - iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]); - }); - } - return seq.__iteratorUncached(type, reverse); +function maybeIndexedSeqFromValue(value) { + return isArrayLike(value) + ? new ArraySeq(value) + : hasIterator(value) + ? new CollectionSeq(value) + : undefined; } diff --git a/src/Set.js b/src/Set.js index f9cdcb626e..cc42bc10f7 100644 --- a/src/Set.js +++ b/src/Set.js @@ -1,34 +1,30 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { SetIterable, KeyedIterable } from './Iterable' -import { SetCollection } from './Collection' -import { emptyMap, MapPrototype } from './Map' -import { DELETE } from './TrieUtils' -import { sortFactory } from './Operations' -import assertNotInfinite from './utils/assertNotInfinite' - -import { OrderedSet } from './OrderedSet' - +import { Collection, SetCollection, KeyedCollection } from './Collection'; +import { isOrdered } from './predicates/isOrdered'; +import { IS_SET_SYMBOL, isSet } from './predicates/isSet'; +import { emptyMap } from './Map'; +import { DELETE } from './TrieUtils'; +import { sortFactory } from './Operations'; +import assertNotInfinite from './utils/assertNotInfinite'; +import { asImmutable } from './methods/asImmutable'; +import { asMutable } from './methods/asMutable'; +import { withMutations } from './methods/withMutations'; + +import { OrderedSet } from './OrderedSet'; export class Set extends SetCollection { - // @pragma Construction constructor(value) { - return value === null || value === undefined ? emptySet() : - isSet(value) ? value : - emptySet().withMutations(set => { - var iter = SetIterable(value); - assertNotInfinite(iter.size); - iter.forEach(v => set.add(v)); - }); + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptySet() + : isSet(value) && !isOrdered(value) + ? value + : emptySet().withMutations((set) => { + const iter = SetCollection(value); + assertNotInfinite(iter.size); + iter.forEach((v) => set.add(v)); + }); } static of(/*...values*/) { @@ -36,7 +32,21 @@ export class Set extends SetCollection { } static fromKeys(value) { - return this(KeyedIterable(value).keySeq()); + return this(KeyedCollection(value).keySeq()); + } + + static intersect(sets) { + sets = Collection(sets).toArray(); + return sets.length + ? SetPrototype.intersect.apply(Set(sets.pop()), sets) + : emptySet(); + } + + static union(sets) { + sets = Collection(sets).toArray(); + return sets.length + ? SetPrototype.union.apply(Set(sets.pop()), sets) + : emptySet(); } toString() { @@ -52,7 +62,7 @@ export class Set extends SetCollection { // @pragma Modification add(value) { - return updateSet(this, this._map.set(value, true)); + return updateSet(this, this._map.set(value, value)); } remove(value) { @@ -65,17 +75,41 @@ export class Set extends SetCollection { // @pragma Composition + map(mapper, context) { + // keep track if the set is altered by the map function + let didChanges = false; + + const newMap = updateSet( + this, + this._map.mapEntries(([, v]) => { + const mapped = mapper.call(context, v, v, this); + + if (mapped !== v) { + didChanges = true; + } + + return [mapped, mapped]; + }, context) + ); + + return didChanges ? newMap : this; + } + union(...iters) { - iters = iters.filter(x => x.size !== 0); + iters = iters.filter((x) => x.size !== 0); if (iters.length === 0) { return this; } if (this.size === 0 && !this.__ownerID && iters.length === 1) { return this.constructor(iters[0]); } - return this.withMutations(set => { - for (var ii = 0; ii < iters.length; ii++) { - SetIterable(iters[ii]).forEach(value => set.add(value)); + return this.withMutations((set) => { + for (let ii = 0; ii < iters.length; ii++) { + if (typeof iters[ii] === 'string') { + set.add(iters[ii]); + } else { + SetCollection(iters[ii]).forEach((value) => set.add(value)); + } } }); } @@ -84,13 +118,16 @@ export class Set extends SetCollection { if (iters.length === 0) { return this; } - iters = iters.map(iter => SetIterable(iter)); - var originalSet = this; - return this.withMutations(set => { - originalSet.forEach(value => { - if (!iters.every(iter => iter.includes(value))) { - set.remove(value); - } + iters = iters.map((iter) => SetCollection(iter)); + const toRemove = []; + this.forEach((value) => { + if (!iters.every((iter) => iter.includes(value))) { + toRemove.push(value); + } + }); + return this.withMutations((set) => { + toRemove.forEach((value) => { + set.remove(value); }); }); } @@ -99,25 +136,20 @@ export class Set extends SetCollection { if (iters.length === 0) { return this; } - iters = iters.map(iter => SetIterable(iter)); - var originalSet = this; - return this.withMutations(set => { - originalSet.forEach(value => { - if (iters.some(iter => iter.includes(value))) { - set.remove(value); - } + iters = iters.map((iter) => SetCollection(iter)); + const toRemove = []; + this.forEach((value) => { + if (iters.some((iter) => iter.includes(value))) { + toRemove.push(value); + } + }); + return this.withMutations((set) => { + toRemove.forEach((value) => { + set.remove(value); }); }); } - merge() { - return this.union.apply(this, arguments); - } - - mergeWith(merger, ...iters) { - return this.union.apply(this, iters); - } - sort(comparator) { // Late binding return OrderedSet(sortFactory(this, comparator)); @@ -133,19 +165,22 @@ export class Set extends SetCollection { } __iterate(fn, reverse) { - return this._map.__iterate((_, k) => fn(k, k, this), reverse); + return this._map.__iterate((k) => fn(k, k, this), reverse); } __iterator(type, reverse) { - return this._map.map((_, k) => k).__iterator(type, reverse); + return this._map.__iterator(type, reverse); } __ensureOwner(ownerID) { if (ownerID === this.__ownerID) { return this; } - var newMap = this._map.__ensureOwner(ownerID); + const newMap = this._map.__ensureOwner(ownerID); if (!ownerID) { + if (this.size === 0) { + return this.__empty(); + } this.__ownerID = ownerID; this._map = newMap; return this; @@ -154,22 +189,21 @@ export class Set extends SetCollection { } } -export function isSet(maybeSet) { - return !!(maybeSet && maybeSet[IS_SET_SENTINEL]); -} - Set.isSet = isSet; -var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@'; - -var SetPrototype = Set.prototype; -SetPrototype[IS_SET_SENTINEL] = true; +const SetPrototype = Set.prototype; +SetPrototype[IS_SET_SYMBOL] = true; SetPrototype[DELETE] = SetPrototype.remove; -SetPrototype.mergeDeep = SetPrototype.merge; -SetPrototype.mergeDeepWith = SetPrototype.mergeWith; -SetPrototype.withMutations = MapPrototype.withMutations; -SetPrototype.asMutable = MapPrototype.asMutable; -SetPrototype.asImmutable = MapPrototype.asImmutable; +SetPrototype.merge = SetPrototype.concat = SetPrototype.union; +SetPrototype.withMutations = withMutations; +SetPrototype.asImmutable = asImmutable; +SetPrototype['@@transducer/init'] = SetPrototype.asMutable = asMutable; +SetPrototype['@@transducer/step'] = function (result, arr) { + return result.add(arr); +}; +SetPrototype['@@transducer/result'] = function (obj) { + return obj.asImmutable(); +}; SetPrototype.__empty = emptySet; SetPrototype.__make = makeSet; @@ -180,20 +214,22 @@ function updateSet(set, newMap) { set._map = newMap; return set; } - return newMap === set._map ? set : - newMap.size === 0 ? set.__empty() : - set.__make(newMap); + return newMap === set._map + ? set + : newMap.size === 0 + ? set.__empty() + : set.__make(newMap); } function makeSet(map, ownerID) { - var set = Object.create(SetPrototype); + const set = Object.create(SetPrototype); set.size = map ? map.size : 0; set._map = map; set.__ownerID = ownerID; return set; } -var EMPTY_SET; +let EMPTY_SET; function emptySet() { return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap())); } diff --git a/src/Stack.js b/src/Stack.js index 26f7d7b9cc..32414fa3a0 100644 --- a/src/Stack.js +++ b/src/Stack.js @@ -1,28 +1,24 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { wholeSlice, resolveBegin, resolveEnd, wrapIndex } from './TrieUtils' -import { IndexedIterable } from './Iterable' -import { IndexedCollection } from './Collection' -import { MapPrototype } from './Map' -import { Iterator, iteratorValue, iteratorDone } from './Iterator' -import assertNotInfinite from './utils/assertNotInfinite' - +import { wholeSlice, resolveBegin, resolveEnd, wrapIndex } from './TrieUtils'; +import { IndexedCollection } from './Collection'; +import { ArraySeq } from './Seq'; +import { Iterator, iteratorValue, iteratorDone } from './Iterator'; +import { IS_STACK_SYMBOL, isStack } from './predicates/isStack'; +import assertNotInfinite from './utils/assertNotInfinite'; +import { asImmutable } from './methods/asImmutable'; +import { asMutable } from './methods/asMutable'; +import { wasAltered } from './methods/wasAltered'; +import { withMutations } from './methods/withMutations'; export class Stack extends IndexedCollection { - // @pragma Construction constructor(value) { - return value === null || value === undefined ? emptyStack() : - isStack(value) ? value : - emptyStack().unshiftAll(value); + // eslint-disable-next-line no-constructor-return + return value === undefined || value === null + ? emptyStack() + : isStack(value) + ? value + : emptyStack().pushAll(value); } static of(/*...values*/) { @@ -36,7 +32,7 @@ export class Stack extends IndexedCollection { // @pragma Access get(index, notSetValue) { - var head = this._head; + let head = this._head; index = wrapIndex(this, index); while (head && index--) { head = head.next; @@ -54,12 +50,12 @@ export class Stack extends IndexedCollection { if (arguments.length === 0) { return this; } - var newSize = this.size + arguments.length; - var head = this._head; - for (var ii = arguments.length - 1; ii >= 0; ii--) { + const newSize = this.size + arguments.length; + let head = this._head; + for (let ii = arguments.length - 1; ii >= 0; ii--) { head = { value: arguments[ii], - next: head + next: head, }; } if (this.__ownerID) { @@ -73,20 +69,23 @@ export class Stack extends IndexedCollection { } pushAll(iter) { - iter = IndexedIterable(iter); + iter = IndexedCollection(iter); if (iter.size === 0) { return this; } + if (this.size === 0 && isStack(iter)) { + return iter; + } assertNotInfinite(iter.size); - var newSize = this.size; - var head = this._head; - iter.reverse().forEach(value => { + let newSize = this.size; + let head = this._head; + iter.__iterate((value) => { newSize++; head = { value: value, - next: head + next: head, }; - }); + }, /* reverse */ true); if (this.__ownerID) { this.size = newSize; this._head = head; @@ -101,18 +100,6 @@ export class Stack extends IndexedCollection { return this.slice(1); } - unshift(/*...values*/) { - return this.push.apply(this, arguments); - } - - unshiftAll(iter) { - return this.pushAll(iter); - } - - shift() { - return this.pop.apply(this, arguments); - } - clear() { if (this.size === 0) { return this; @@ -131,14 +118,14 @@ export class Stack extends IndexedCollection { if (wholeSlice(begin, end, this.size)) { return this; } - var resolvedBegin = resolveBegin(begin, this.size); - var resolvedEnd = resolveEnd(end, this.size); + let resolvedBegin = resolveBegin(begin, this.size); + const resolvedEnd = resolveEnd(end, this.size); if (resolvedEnd !== this.size) { // super.slice(begin, end); return IndexedCollection.prototype.slice.call(this, begin, end); } - var newSize = this.size - resolvedBegin; - var head = this._head; + const newSize = this.size - resolvedBegin; + let head = this._head; while (resolvedBegin--) { head = head.next; } @@ -159,6 +146,9 @@ export class Stack extends IndexedCollection { return this; } if (!ownerID) { + if (this.size === 0) { + return emptyStack(); + } this.__ownerID = ownerID; this.__altered = false; return this; @@ -170,10 +160,13 @@ export class Stack extends IndexedCollection { __iterate(fn, reverse) { if (reverse) { - return this.reverse().__iterate(fn); + return new ArraySeq(this.toArray()).__iterate( + (v, k) => fn(v, k, this), + reverse + ); } - var iterations = 0; - var node = this._head; + let iterations = 0; + let node = this._head; while (node) { if (fn(node.value, iterations++, this) === false) { break; @@ -185,13 +178,13 @@ export class Stack extends IndexedCollection { __iterator(type, reverse) { if (reverse) { - return this.reverse().__iterator(type); + return new ArraySeq(this.toArray()).__iterator(type, reverse); } - var iterations = 0; - var node = this._head; + let iterations = 0; + let node = this._head; return new Iterator(() => { if (node) { - var value = node.value; + const value = node.value; node = node.next; return iteratorValue(type, iterations++, value); } @@ -200,24 +193,26 @@ export class Stack extends IndexedCollection { } } -function isStack(maybeStack) { - return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]); -} - Stack.isStack = isStack; -var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@'; - -var StackPrototype = Stack.prototype; -StackPrototype[IS_STACK_SENTINEL] = true; -StackPrototype.withMutations = MapPrototype.withMutations; -StackPrototype.asMutable = MapPrototype.asMutable; -StackPrototype.asImmutable = MapPrototype.asImmutable; -StackPrototype.wasAltered = MapPrototype.wasAltered; - +const StackPrototype = Stack.prototype; +StackPrototype[IS_STACK_SYMBOL] = true; +StackPrototype.shift = StackPrototype.pop; +StackPrototype.unshift = StackPrototype.push; +StackPrototype.unshiftAll = StackPrototype.pushAll; +StackPrototype.withMutations = withMutations; +StackPrototype.wasAltered = wasAltered; +StackPrototype.asImmutable = asImmutable; +StackPrototype['@@transducer/init'] = StackPrototype.asMutable = asMutable; +StackPrototype['@@transducer/step'] = function (result, arr) { + return result.unshift(arr); +}; +StackPrototype['@@transducer/result'] = function (obj) { + return obj.asImmutable(); +}; function makeStack(size, head, ownerID, hash) { - var map = Object.create(StackPrototype); + const map = Object.create(StackPrototype); map.size = size; map._head = head; map.__ownerID = ownerID; @@ -226,7 +221,7 @@ function makeStack(size, head, ownerID, hash) { return map; } -var EMPTY_STACK; +let EMPTY_STACK; function emptyStack() { return EMPTY_STACK || (EMPTY_STACK = makeStack(0)); } diff --git a/src/TrieUtils.js b/src/TrieUtils.js deleted file mode 100644 index 8b9afe3fd1..0000000000 --- a/src/TrieUtils.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - - -// Used for setting prototype methods that IE8 chokes on. -export var DELETE = 'delete'; - -// Constants describing the size of trie nodes. -export var SHIFT = 5; // Resulted in best performance after ______? -export var SIZE = 1 << SHIFT; -export var MASK = SIZE - 1; - -// A consistent shared value representing "not set" which equals nothing other -// than itself, and nothing that could be provided externally. -export var NOT_SET = {}; - -// Boolean references, Rough equivalent of `bool &`. -export var CHANGE_LENGTH = { value: false }; -export var DID_ALTER = { value: false }; - -export function MakeRef(ref) { - ref.value = false; - return ref; -} - -export function SetRef(ref) { - ref && (ref.value = true); -} - -// A function which returns a value representing an "owner" for transient writes -// to tries. The return value will only ever equal itself, and will not equal -// the return of any subsequent call of this function. -export function OwnerID() {} - -// http://jsperf.com/copy-array-inline -export function arrCopy(arr, offset) { - offset = offset || 0; - var len = Math.max(0, arr.length - offset); - var newArr = new Array(len); - for (var ii = 0; ii < len; ii++) { - newArr[ii] = arr[ii + offset]; - } - return newArr; -} - -export function ensureSize(iter) { - if (iter.size === undefined) { - iter.size = iter.__iterate(returnTrue); - } - return iter.size; -} - -export function wrapIndex(iter, index) { - return index >= 0 ? (+index) : ensureSize(iter) + (+index); -} - -export function returnTrue() { - return true; -} - -export function wholeSlice(begin, end, size) { - return (begin === 0 || (size !== undefined && begin <= -size)) && - (end === undefined || (size !== undefined && end >= size)); -} - -export function resolveBegin(begin, size) { - return resolveIndex(begin, size, 0); -} - -export function resolveEnd(end, size) { - return resolveIndex(end, size, size); -} - -function resolveIndex(index, size, defaultIndex) { - return index === undefined ? - defaultIndex : - index < 0 ? - Math.max(0, size + index) : - size === undefined ? - index : - Math.min(size, index); -} diff --git a/src/TrieUtils.ts b/src/TrieUtils.ts new file mode 100644 index 0000000000..d5c75c179b --- /dev/null +++ b/src/TrieUtils.ts @@ -0,0 +1,105 @@ +import type { Collection } from '../type-definitions/immutable'; + +// Used for setting prototype methods that IE8 chokes on. +export const DELETE = 'delete'; + +// Constants describing the size of trie nodes. +export const SHIFT = 5; // Resulted in best performance after ______? +export const SIZE = 1 << SHIFT; +export const MASK = SIZE - 1; + +// A consistent shared value representing "not set" which equals nothing other +// than itself, and nothing that could be provided externally. +export const NOT_SET = {}; + +type Ref = { value: boolean }; + +// Boolean references, Rough equivalent of `bool &`. +export function MakeRef(): Ref { + return { value: false }; +} + +export function SetRef(ref: Ref): void { + if (ref) { + ref.value = true; + } +} + +// A function which returns a value representing an "owner" for transient writes +// to tries. The return value will only ever equal itself, and will not equal +// the return of any subsequent call of this function. +export function OwnerID() {} + +export function ensureSize(iter: Collection): number { + // @ts-expect-error size should exists on Collection + if (iter.size === undefined) { + // @ts-expect-error size should exists on Collection, __iterate does exist on Collection + iter.size = iter.__iterate(returnTrue); + } + // @ts-expect-error size should exists on Collection + return iter.size; +} + +export function wrapIndex( + iter: Collection, + index: number +): number { + // This implements "is array index" which the ECMAString spec defines as: + // + // A String property name P is an array index if and only if + // ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal + // to 2^32−1. + // + // http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects + if (typeof index !== 'number') { + const uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32 + if ('' + uint32Index !== index || uint32Index === 4294967295) { + return NaN; + } + index = uint32Index; + } + return index < 0 ? ensureSize(iter) + index : index; +} + +export function returnTrue(): true { + return true; +} + +export function wholeSlice(begin: number, end: number, size: number): boolean { + return ( + ((begin === 0 && !isNeg(begin)) || + (size !== undefined && begin <= -size)) && + (end === undefined || (size !== undefined && end >= size)) + ); +} + +export function resolveBegin(begin: number, size: number): number { + return resolveIndex(begin, size, 0); +} + +export function resolveEnd(end: number, size: number): number { + return resolveIndex(end, size, size); +} + +function resolveIndex( + index: number, + size: number, + defaultIndex: number +): number { + // Sanitize indices using this shorthand for ToInt32(argument) + // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32 + return index === undefined + ? defaultIndex + : isNeg(index) + ? size === Infinity + ? size + : Math.max(0, size + index) | 0 + : size === undefined || size === index + ? index + : Math.min(size, index) | 0; +} + +function isNeg(value: number): boolean { + // Account for -0 which is negative, but not less than 0. + return value < 0 || (value === 0 && 1 / value === -Infinity); +} diff --git a/src/fromJS.js b/src/fromJS.js index a393ebaf4a..7586c12a58 100644 --- a/src/fromJS.js +++ b/src/fromJS.js @@ -1,40 +1,51 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +import { Seq } from './Seq'; +import { hasIterator } from './Iterator'; +import { isImmutable } from './predicates/isImmutable'; +import { isIndexed } from './predicates/isIndexed'; +import { isKeyed } from './predicates/isKeyed'; +import isArrayLike from './utils/isArrayLike'; +import isPlainObj from './utils/isPlainObj'; -import { KeyedSeq, IndexedSeq } from './Seq' - -export function fromJS(json, converter) { - return converter ? - fromJSWith(converter, json, '', {'': json}) : - fromJSDefault(json); -} - -function fromJSWith(converter, json, key, parentJSON) { - if (Array.isArray(json)) { - return converter.call(parentJSON, key, IndexedSeq(json).map((v, k) => fromJSWith(converter, v, k, json))); - } - if (isPlainObj(json)) { - return converter.call(parentJSON, key, KeyedSeq(json).map((v, k) => fromJSWith(converter, v, k, json))); - } - return json; +export function fromJS(value, converter) { + return fromJSWith( + [], + converter || defaultConverter, + value, + '', + converter && converter.length > 2 ? [] : undefined, + { '': value } + ); } -function fromJSDefault(json) { - if (Array.isArray(json)) { - return IndexedSeq(json).map(fromJSDefault).toList(); - } - if (isPlainObj(json)) { - return KeyedSeq(json).map(fromJSDefault).toMap(); +function fromJSWith(stack, converter, value, key, keyPath, parentValue) { + if ( + typeof value !== 'string' && + !isImmutable(value) && + (isArrayLike(value) || hasIterator(value) || isPlainObj(value)) + ) { + if (~stack.indexOf(value)) { + throw new TypeError('Cannot convert circular structure to Immutable'); + } + stack.push(value); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + keyPath && key !== '' && keyPath.push(key); + const converted = converter.call( + parentValue, + key, + Seq(value).map((v, k) => + fromJSWith(stack, converter, v, k, keyPath, value) + ), + keyPath && keyPath.slice() + ); + stack.pop(); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + keyPath && keyPath.pop(); + return converted; } - return json; + return value; } -function isPlainObj(value) { - return value && (value.constructor === Object || value.constructor === undefined); +function defaultConverter(k, v) { + // Effectively the opposite of "Collection.toSeq()" + return isIndexed(v) ? v.toList() : isKeyed(v) ? v.toMap() : v.toSet(); } diff --git a/src/functional/get.ts b/src/functional/get.ts new file mode 100644 index 0000000000..e6306b8f58 --- /dev/null +++ b/src/functional/get.ts @@ -0,0 +1,72 @@ +import type { Collection, Record } from '../../type-definitions/immutable'; +import { isImmutable } from '../predicates/isImmutable'; +import { has } from './has'; + +/** + * Returns the value within the provided collection associated with the + * provided key, or notSetValue if the key is not defined in the collection. + * + * A functional alternative to `collection.get(key)` which will also work on + * plain Objects and Arrays as an alternative for `collection[key]`. + * + * + * ```js + * import { get } from 'immutable'; + * + * get([ 'dog', 'frog', 'cat' ], 1) // 'frog' + * get({ x: 123, y: 456 }, 'x') // 123 + * get({ x: 123, y: 456 }, 'z', 'ifNotSet') // 'ifNotSet' + * ``` + */ +export function get(collection: Collection, key: K): V | undefined; +export function get( + collection: Collection, + key: K, + notSetValue: NSV +): V | NSV; +export function get( + record: Record, + key: K, + notSetValue: unknown +): TProps[K]; +export function get(collection: Array, key: number): V | undefined; +export function get( + collection: Array, + key: number, + notSetValue: NSV +): V | NSV; +export function get( + object: C, + key: K, + notSetValue: unknown +): C[K]; +export function get( + collection: { [key: string]: V }, + key: string +): V | undefined; +export function get( + collection: { [key: string]: V }, + key: string, + notSetValue: NSV +): V | NSV; +export function get( + collection: Collection | Array | { [key: string]: V }, + key: K, + notSetValue?: NSV +): V | NSV; +export function get( + collection: Collection | Array | { [key: string]: V }, + key: K, + notSetValue?: NSV +): V | NSV { + return isImmutable(collection) + ? collection.get(key, notSetValue) + : !has(collection, key) + ? notSetValue + : // @ts-expect-error weird "get" here, + typeof collection.get === 'function' + ? // @ts-expect-error weird "get" here, + collection.get(key) + : // @ts-expect-error key is unknown here, + collection[key]; +} diff --git a/src/functional/getIn.ts b/src/functional/getIn.ts new file mode 100644 index 0000000000..11f9cdf384 --- /dev/null +++ b/src/functional/getIn.ts @@ -0,0 +1,41 @@ +import coerceKeyPath from '../utils/coerceKeyPath'; +import { NOT_SET } from '../TrieUtils'; +import { get } from './get'; +import type { KeyPath } from '../../type-definitions/immutable'; + +type GetType = typeof get; +type GetTypeParameters = Parameters; +type CollectionType = GetTypeParameters[0]; +type Key = GetTypeParameters[1]; + +/** + * Returns the value at the provided key path starting at the provided + * collection, or notSetValue if the key path is not defined. + * + * A functional alternative to `collection.getIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * import { getIn } from 'immutable'; + * + * getIn({ x: { y: { z: 123 }}}, ['x', 'y', 'z']) // 123 + * getIn({ x: { y: { z: 123 }}}, ['x', 'q', 'p'], 'ifNotSet') // 'ifNotSet' + * ``` + */ +export function getIn( + collection: CollectionType, + searchKeyPath: KeyPath, + notSetValue?: GetTypeParameters[2] +): ReturnType { + const keyPath = coerceKeyPath(searchKeyPath); + let i = 0; + while (i !== keyPath.length) { + // @ts-expect-error keyPath[i++] can not be undefined by design + collection = get(collection, keyPath[i++], NOT_SET); + if (collection === NOT_SET) { + return notSetValue; + } + } + return collection; +} diff --git a/src/functional/has.ts b/src/functional/has.ts new file mode 100644 index 0000000000..322370314e --- /dev/null +++ b/src/functional/has.ts @@ -0,0 +1,28 @@ +import { isImmutable } from '../predicates/isImmutable'; +import hasOwnProperty from '../utils/hasOwnProperty'; +import isDataStructure from '../utils/isDataStructure'; + +/** + * Returns true if the key is defined in the provided collection. + * + * A functional alternative to `collection.has(key)` which will also work with + * plain Objects and Arrays as an alternative for + * `collection.hasOwnProperty(key)`. + * + * + * ```js + * import { has } from 'immutable'; + * + * has([ 'dog', 'frog', 'cat' ], 2) // true + * has([ 'dog', 'frog', 'cat' ], 5) // false + * has({ x: 123, y: 456 }, 'x') // true + * has({ x: 123, y: 456 }, 'z') // false + * ``` + */ +export function has(collection: object, key: unknown): boolean { + return isImmutable(collection) + ? // @ts-expect-error key might be a number or symbol, which is not handled be Record key type + collection.has(key) + : // @ts-expect-error key might be anything else than PropertyKey, and will return false in that case but runtime is OK + isDataStructure(collection) && hasOwnProperty.call(collection, key); +} diff --git a/src/functional/hasIn.ts b/src/functional/hasIn.ts new file mode 100644 index 0000000000..28041a7323 --- /dev/null +++ b/src/functional/hasIn.ts @@ -0,0 +1,25 @@ +import { getIn } from './getIn'; +import { NOT_SET } from '../TrieUtils'; + +type GetInParameters = Parameters; + +/** + * Returns true if the key path is defined in the provided collection. + * + * A functional alternative to `collection.hasIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * import { hasIn } from 'immutable'; + * + * hasIn({ x: { y: { z: 123 }}}, ['x', 'y', 'z']) // true + * hasIn({ x: { y: { z: 123 }}}, ['x', 'q', 'p']) // false + * ``` + */ +export function hasIn( + collection: GetInParameters[0], + keyPath: GetInParameters[1] +): boolean { + return getIn(collection, keyPath, NOT_SET) !== NOT_SET; +} diff --git a/src/functional/merge.js b/src/functional/merge.js new file mode 100644 index 0000000000..b2d231a0c9 --- /dev/null +++ b/src/functional/merge.js @@ -0,0 +1,99 @@ +import { isImmutable } from '../predicates/isImmutable'; +import { isIndexed } from '../predicates/isIndexed'; +import { isKeyed } from '../predicates/isKeyed'; +import { IndexedCollection, KeyedCollection } from '../Collection'; +import { Seq } from '../Seq'; +import hasOwnProperty from '../utils/hasOwnProperty'; +import isDataStructure from '../utils/isDataStructure'; +import shallowCopy from '../utils/shallowCopy'; + +export function merge(collection, ...sources) { + return mergeWithSources(collection, sources); +} + +export function mergeWith(merger, collection, ...sources) { + return mergeWithSources(collection, sources, merger); +} + +export function mergeDeep(collection, ...sources) { + return mergeDeepWithSources(collection, sources); +} + +export function mergeDeepWith(merger, collection, ...sources) { + return mergeDeepWithSources(collection, sources, merger); +} + +export function mergeDeepWithSources(collection, sources, merger) { + return mergeWithSources(collection, sources, deepMergerWith(merger)); +} + +export function mergeWithSources(collection, sources, merger) { + if (!isDataStructure(collection)) { + throw new TypeError( + 'Cannot merge into non-data-structure value: ' + collection + ); + } + if (isImmutable(collection)) { + return typeof merger === 'function' && collection.mergeWith + ? collection.mergeWith(merger, ...sources) + : collection.merge + ? collection.merge(...sources) + : collection.concat(...sources); + } + const isArray = Array.isArray(collection); + let merged = collection; + const Collection = isArray ? IndexedCollection : KeyedCollection; + const mergeItem = isArray + ? (value) => { + // Copy on write + if (merged === collection) { + merged = shallowCopy(merged); + } + merged.push(value); + } + : (value, key) => { + const hasVal = hasOwnProperty.call(merged, key); + const nextVal = + hasVal && merger ? merger(merged[key], value, key) : value; + if (!hasVal || nextVal !== merged[key]) { + // Copy on write + if (merged === collection) { + merged = shallowCopy(merged); + } + merged[key] = nextVal; + } + }; + for (let i = 0; i < sources.length; i++) { + Collection(sources[i]).forEach(mergeItem); + } + return merged; +} + +function deepMergerWith(merger) { + function deepMerger(oldValue, newValue, key) { + return isDataStructure(oldValue) && + isDataStructure(newValue) && + areMergeable(oldValue, newValue) + ? mergeWithSources(oldValue, [newValue], deepMerger) + : merger + ? merger(oldValue, newValue, key) + : newValue; + } + return deepMerger; +} + +/** + * It's unclear what the desired behavior is for merging two collections that + * fall into separate categories between keyed, indexed, or set-like, so we only + * consider them mergeable if they fall into the same category. + */ +function areMergeable(oldDataStructure, newDataStructure) { + const oldSeq = Seq(oldDataStructure); + const newSeq = Seq(newDataStructure); + // This logic assumes that a sequence can only fall into one of the three + // categories mentioned above (since there's no `isSetLike()` method). + return ( + isIndexed(oldSeq) === isIndexed(newSeq) && + isKeyed(oldSeq) === isKeyed(newSeq) + ); +} diff --git a/src/functional/remove.ts b/src/functional/remove.ts new file mode 100644 index 0000000000..60aff0fa36 --- /dev/null +++ b/src/functional/remove.ts @@ -0,0 +1,83 @@ +import type { Collection, Record } from '../../type-definitions/immutable'; +import { isImmutable } from '../predicates/isImmutable'; +import hasOwnProperty from '../utils/hasOwnProperty'; +import isDataStructure from '../utils/isDataStructure'; +import shallowCopy from '../utils/shallowCopy'; + +/** + * Returns a copy of the collection with the value at key removed. + * + * A functional alternative to `collection.remove(key)` which will also work + * with plain Objects and Arrays as an alternative for + * `delete collectionCopy[key]`. + * + * + * ```js + * import { remove } from 'immutable'; + * + * const originalArray = [ 'dog', 'frog', 'cat' ] + * remove(originalArray, 1) // [ 'dog', 'cat' ] + * console.log(originalArray) // [ 'dog', 'frog', 'cat' ] + * const originalObject = { x: 123, y: 456 } + * remove(originalObject, 'x') // { y: 456 } + * console.log(originalObject) // { x: 123, y: 456 } + * ``` + */ +export function remove>( + collection: C, + key: K +): C; +export function remove< + TProps extends object, + C extends Record, + K extends keyof TProps, +>(collection: C, key: K): C; +export function remove>(collection: C, key: number): C; +export function remove(collection: C, key: K): C; +export function remove< + C extends { [key: PropertyKey]: unknown }, + K extends keyof C, +>(collection: C, key: K): C; +export function remove< + K, + C extends + | Collection + | Array + | { [key: PropertyKey]: unknown }, +>(collection: C, key: K): C; +export function remove( + collection: + | Collection + | Array + | { [key: PropertyKey]: unknown }, + key: K +) { + if (!isDataStructure(collection)) { + throw new TypeError( + 'Cannot update non-data-structure value: ' + collection + ); + } + if (isImmutable(collection)) { + // @ts-expect-error weird "remove" here, + if (!collection.remove) { + throw new TypeError( + 'Cannot update immutable value without .remove() method: ' + collection + ); + } + // @ts-expect-error weird "remove" here, + return collection.remove(key); + } + // @ts-expect-error assert that key is a string, a number or a symbol here + if (!hasOwnProperty.call(collection, key)) { + return collection; + } + const collectionCopy = shallowCopy(collection); + if (Array.isArray(collectionCopy)) { + // @ts-expect-error assert that key is a number here + collectionCopy.splice(key, 1); + } else { + // @ts-expect-error assert that key is a string, a number or a symbol here + delete collectionCopy[key]; + } + return collectionCopy; +} diff --git a/src/functional/removeIn.ts b/src/functional/removeIn.ts new file mode 100644 index 0000000000..3b97be0dcd --- /dev/null +++ b/src/functional/removeIn.ts @@ -0,0 +1,27 @@ +import { updateIn, type PossibleCollection } from './updateIn'; +import { NOT_SET } from '../TrieUtils'; +import type { KeyPath } from '../../type-definitions/immutable'; + +/** + * Returns a copy of the collection with the value at the key path removed. + * + * A functional alternative to `collection.removeIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * import { removeIn } from 'immutable'; + * + * const original = { x: { y: { z: 123 }}} + * removeIn(original, ['x', 'y', 'z']) // { x: { y: {}}} + * console.log(original) // { x: { y: { z: 123 }}} + * ``` + */ +export function removeIn< + K extends PropertyKey, + V, + TProps extends object, + C extends PossibleCollection, +>(collection: C, keyPath: KeyPath): C { + return updateIn(collection, keyPath, () => NOT_SET); +} diff --git a/src/functional/set.ts b/src/functional/set.ts new file mode 100644 index 0000000000..e8e688abd0 --- /dev/null +++ b/src/functional/set.ts @@ -0,0 +1,76 @@ +import type { Collection, Record } from '../../type-definitions/immutable'; +import { isImmutable } from '../predicates/isImmutable'; +import hasOwnProperty from '../utils/hasOwnProperty'; +import isDataStructure from '../utils/isDataStructure'; +import shallowCopy from '../utils/shallowCopy'; + +/** + * Returns a copy of the collection with the value at key set to the provided + * value. + * + * A functional alternative to `collection.set(key, value)` which will also + * work with plain Objects and Arrays as an alternative for + * `collectionCopy[key] = value`. + * + * + * ```js + * import { set } from 'immutable'; + * + * const originalArray = [ 'dog', 'frog', 'cat' ] + * set(originalArray, 1, 'cow') // [ 'dog', 'cow', 'cat' ] + * console.log(originalArray) // [ 'dog', 'frog', 'cat' ] + * const originalObject = { x: 123, y: 456 } + * set(originalObject, 'x', 789) // { x: 789, y: 456 } + * console.log(originalObject) // { x: 123, y: 456 } + * ``` + */ +export function set>( + collection: C, + key: K, + value: V +): C; +export function set< + TProps extends object, + C extends Record, + K extends keyof TProps, +>(record: C, key: K, value: TProps[K]): C; +export function set>( + collection: C, + key: number, + value: V +): C; +export function set(object: C, key: K, value: C[K]): C; +export function set( + collection: C, + key: string, + value: V +): C; +export function set | { [key: string]: V }>( + collection: C, + key: K | string, + value: V +): C { + if (!isDataStructure(collection)) { + throw new TypeError( + 'Cannot update non-data-structure value: ' + collection + ); + } + if (isImmutable(collection)) { + // @ts-expect-error weird "set" here, + if (!collection.set) { + throw new TypeError( + 'Cannot update immutable value without .set() method: ' + collection + ); + } + // @ts-expect-error weird "set" here, + return collection.set(key, value); + } + // @ts-expect-error mix of key and string here. Probably need a more fine type here + if (hasOwnProperty.call(collection, key) && value === collection[key]) { + return collection; + } + const collectionCopy = shallowCopy(collection); + // @ts-expect-error mix of key and string here. Probably need a more fine type here + collectionCopy[key] = value; + return collectionCopy; +} diff --git a/src/functional/setIn.ts b/src/functional/setIn.ts new file mode 100644 index 0000000000..7955e3e38d --- /dev/null +++ b/src/functional/setIn.ts @@ -0,0 +1,28 @@ +import { updateIn, type PossibleCollection } from './updateIn'; +import { NOT_SET } from '../TrieUtils'; +import type { KeyPath } from '../../type-definitions/immutable'; + +/** + * Returns a copy of the collection with the value at the key path set to the + * provided value. + * + * A functional alternative to `collection.setIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * import { setIn } from 'immutable'; + * + * const original = { x: { y: { z: 123 }}} + * setIn(original, ['x', 'y', 'z'], 456) // { x: { y: { z: 456 }}} + * console.log(original) // { x: { y: { z: 123 }}} + * ``` + */ +export function setIn< + K extends PropertyKey, + V, + TProps extends object, + C extends PossibleCollection, +>(collection: C, keyPath: KeyPath, value: unknown): C { + return updateIn(collection, keyPath, NOT_SET, () => value); +} diff --git a/src/functional/update.ts b/src/functional/update.ts new file mode 100644 index 0000000000..81d5426539 --- /dev/null +++ b/src/functional/update.ts @@ -0,0 +1,112 @@ +import type { Collection, Record } from '../../type-definitions/immutable'; +import { updateIn, type PossibleCollection } from './updateIn'; + +type UpdaterFunction = (value: V | undefined) => V | undefined; +type UpdaterFunctionWithNSV = (value: V | NSV) => V; + +/** + * Returns a copy of the collection with the value at key set to the result of + * providing the existing value to the updating function. + * + * A functional alternative to `collection.update(key, fn)` which will also + * work with plain Objects and Arrays as an alternative for + * `collectionCopy[key] = fn(collection[key])`. + * + * + * ```js + * import { update } from 'immutable'; + * + * const originalArray = [ 'dog', 'frog', 'cat' ] + * update(originalArray, 1, val => val.toUpperCase()) // [ 'dog', 'FROG', 'cat' ] + * console.log(originalArray) // [ 'dog', 'frog', 'cat' ] + * const originalObject = { x: 123, y: 456 } + * update(originalObject, 'x', val => val * 6) // { x: 738, y: 456 } + * console.log(originalObject) // { x: 123, y: 456 } + * ``` + */ +export function update>( + collection: C, + key: K, + updater: (value: V | undefined) => V | undefined +): C; +export function update, NSV>( + collection: C, + key: K, + notSetValue: NSV, + updater: (value: V | NSV) => V +): C; +export function update< + TProps extends object, + C extends Record, + K extends keyof TProps, +>(record: C, key: K, updater: (value: TProps[K]) => TProps[K]): C; +export function update< + TProps extends object, + C extends Record, + K extends keyof TProps, + NSV, +>( + record: C, + key: K, + notSetValue: NSV, + updater: (value: TProps[K] | NSV) => TProps[K] +): C; +export function update>( + collection: C, + key: number, + updater: UpdaterFunction +): C; +export function update, NSV>( + collection: C, + key: number, + notSetValue: NSV, + updater: (value: V | NSV) => V +): C; +export function update( + object: C, + key: K, + updater: (value: C[K]) => C[K] +): C; +export function update( + object: C, + key: K, + notSetValue: NSV, + updater: (value: C[K] | NSV) => C[K] +): C; +export function update( + collection: C, + key: K, + updater: (value: V) => V +): { [key: string]: V }; +export function update< + V, + C extends { [key: string]: V }, + K extends keyof C, + NSV, +>( + collection: C, + key: K, + notSetValue: NSV, + updater: (value: V | NSV) => V +): { [key: string]: V }; + +export function update< + K, + V, + TProps extends object, + C extends PossibleCollection, + NSV, +>( + collection: C, + key: K, + notSetValue: NSV | UpdaterFunction, + updater?: UpdaterFunctionWithNSV +) { + return updateIn( + // @ts-expect-error Index signature for type string is missing in type V[] + collection, + [key], + notSetValue, + updater + ); +} diff --git a/src/functional/updateIn.ts b/src/functional/updateIn.ts new file mode 100644 index 0000000000..99eed7980e --- /dev/null +++ b/src/functional/updateIn.ts @@ -0,0 +1,189 @@ +import { isImmutable } from '../predicates/isImmutable'; +import coerceKeyPath from '../utils/coerceKeyPath'; +import isDataStructure from '../utils/isDataStructure'; +import quoteString from '../utils/quoteString'; +import { NOT_SET } from '../TrieUtils'; +import { emptyMap } from '../Map'; +import { get } from './get'; +import { remove } from './remove'; +import { set } from './set'; +import type { + Collection, + KeyPath, + Record, + RetrievePath, +} from '../../type-definitions/immutable'; + +/** + * Returns a copy of the collection with the value at key path set to the + * result of providing the existing value to the updating function. + * + * A functional alternative to `collection.updateIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * import { updateIn } from 'immutable' + * + * const original = { x: { y: { z: 123 }}} + * updateIn(original, ['x', 'y', 'z'], val => val * 6) // { x: { y: { z: 738 }}} + * console.log(original) // { x: { y: { z: 123 }}} + * ``` + */ + +export type PossibleCollection = + | Collection + | Record + | Array; + +type UpdaterFunction = ( + value: RetrievePath> | undefined +) => unknown | undefined; +type UpdaterFunctionWithNSV = ( + value: RetrievePath> | NSV +) => unknown; + +export function updateIn>( + collection: C, + keyPath: KeyPath, + updater: UpdaterFunction +): C; +export function updateIn, NSV>( + collection: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: UpdaterFunctionWithNSV +): C; +export function updateIn< + TProps extends object, + C extends Record, + K extends keyof TProps, +>(record: C, keyPath: KeyPath, updater: UpdaterFunction): C; +export function updateIn< + TProps extends object, + C extends Record, + K extends keyof TProps, + NSV, +>( + record: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: UpdaterFunctionWithNSV +): C; +export function updateIn>( + collection: C, + keyPath: KeyPath, + updater: UpdaterFunction +): Array; +export function updateIn, NSV>( + collection: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: UpdaterFunctionWithNSV +): Array; +export function updateIn( + object: C, + keyPath: KeyPath, + updater: UpdaterFunction +): C; +export function updateIn( + object: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: UpdaterFunctionWithNSV +): C; +export function updateIn( + collection: C, + keyPath: KeyPath, + updater: UpdaterFunction +): { [key: PropertyKey]: V }; +export function updateIn( + collection: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: UpdaterFunction +): { [key: PropertyKey]: V }; + +export function updateIn< + K, + V, + TProps extends object, + C extends PossibleCollection, + NSV, +>( + collection: C, + keyPath: KeyPath, + notSetValue: NSV | UpdaterFunction | undefined, + updater?: UpdaterFunctionWithNSV +): C { + if (!updater) { + // handle the fact that `notSetValue` is optional here, in that case `updater` is the updater function + // @ts-expect-error updater is a function here + updater = notSetValue as UpdaterFunction; + notSetValue = undefined; + } + const updatedValue = updateInDeeply( + isImmutable(collection), + // @ts-expect-error type issues with Record and mixed types + collection, + coerceKeyPath(keyPath), + 0, + notSetValue, + updater + ); + // @ts-expect-error mixed return type + return updatedValue === NOT_SET ? notSetValue : updatedValue; +} + +function updateInDeeply< + K, + TProps extends object, + C extends PossibleCollection, + NSV, +>( + inImmutable: boolean, + existing: C, + keyPath: Array, + i: number, + notSetValue: NSV | undefined, + updater: UpdaterFunctionWithNSV | UpdaterFunction +): C { + const wasNotSet = existing === NOT_SET; + if (i === keyPath.length) { + const existingValue = wasNotSet ? notSetValue : existing; + // @ts-expect-error mixed type with optional value + const newValue = updater(existingValue); + // @ts-expect-error mixed type + return newValue === existingValue ? existing : newValue; + } + if (!wasNotSet && !isDataStructure(existing)) { + throw new TypeError( + 'Cannot update within non-data-structure value in path [' + + Array.from(keyPath).slice(0, i).map(quoteString) + + ']: ' + + existing + ); + } + const key = keyPath[i]; + + const nextExisting = wasNotSet ? NOT_SET : get(existing, key, NOT_SET); + const nextUpdated = updateInDeeply( + nextExisting === NOT_SET ? inImmutable : isImmutable(nextExisting), + // @ts-expect-error mixed type + nextExisting, + keyPath, + i + 1, + notSetValue, + updater + ); + + return nextUpdated === nextExisting + ? existing + : nextUpdated === NOT_SET + ? remove(existing, key) + : set( + wasNotSet ? (inImmutable ? emptyMap() : {}) : existing, + key, + nextUpdated + ); +} diff --git a/src/is.js b/src/is.ts similarity index 78% rename from src/is.js rename to src/is.ts index 4feaa66aef..f4430c52fd 100644 --- a/src/is.js +++ b/src/is.ts @@ -1,11 +1,4 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ +import { isValueObject } from './predicates/isValueObject'; /** * An extension of the "same-value" algorithm as [described for use by ES6 Map @@ -40,7 +33,7 @@ * not be performant. An alternative is to implement `equals` and `hashCode`. * * `equals` takes another object, presumably of similar type, and returns true - * if the it is equal. Equality is symmetrical, so the same result should be + * if it is equal. Equality is symmetrical, so the same result should be * returned if this and the argument are flipped. * * assert( a.equals(b) === b.equals(a) ); @@ -58,18 +51,20 @@ * assert( a.hashCode() === b.hashCode() ); * } * - * All Immutable collections implement `equals` and `hashCode`. - * + * All Immutable collections are Value Objects: they implement `equals()` + * and `hashCode()`. */ -export function is(valueA, valueB) { +export function is(valueA: unknown, valueB: unknown): boolean { if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { return true; } if (!valueA || !valueB) { return false; } - if (typeof valueA.valueOf === 'function' && - typeof valueB.valueOf === 'function') { + if ( + typeof valueA.valueOf === 'function' && + typeof valueB.valueOf === 'function' + ) { valueA = valueA.valueOf(); valueB = valueB.valueOf(); if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) { @@ -79,10 +74,9 @@ export function is(valueA, valueB) { return false; } } - if (typeof valueA.equals === 'function' && - typeof valueB.equals === 'function' && - valueA.equals(valueB)) { - return true; - } - return false; + return !!( + isValueObject(valueA) && + isValueObject(valueB) && + valueA.equals(valueB) + ); } diff --git a/src/methods/README.md b/src/methods/README.md new file mode 100644 index 0000000000..df2d26482f --- /dev/null +++ b/src/methods/README.md @@ -0,0 +1,5 @@ +These files represent common methods on Collection types, each will contain +references to "this" - expecting to be called as a prototypal method. + +They are separated into individual files to avoid circular dependencies when +possible, and to allow their use in multiple different Collections. diff --git a/src/methods/asImmutable.js b/src/methods/asImmutable.js new file mode 100644 index 0000000000..71ba0d2bf5 --- /dev/null +++ b/src/methods/asImmutable.js @@ -0,0 +1,3 @@ +export function asImmutable() { + return this.__ensureOwner(); +} diff --git a/src/methods/asMutable.js b/src/methods/asMutable.js new file mode 100644 index 0000000000..2e7abf576a --- /dev/null +++ b/src/methods/asMutable.js @@ -0,0 +1,5 @@ +import { OwnerID } from '../TrieUtils'; + +export function asMutable() { + return this.__ownerID ? this : this.__ensureOwner(new OwnerID()); +} diff --git a/src/methods/deleteIn.js b/src/methods/deleteIn.js new file mode 100644 index 0000000000..5a312ce8f9 --- /dev/null +++ b/src/methods/deleteIn.js @@ -0,0 +1,5 @@ +import { removeIn } from '../functional/removeIn'; + +export function deleteIn(keyPath) { + return removeIn(this, keyPath); +} diff --git a/src/methods/getIn.js b/src/methods/getIn.js new file mode 100644 index 0000000000..e202bae92c --- /dev/null +++ b/src/methods/getIn.js @@ -0,0 +1,5 @@ +import { getIn as _getIn } from '../functional/getIn'; + +export function getIn(searchKeyPath, notSetValue) { + return _getIn(this, searchKeyPath, notSetValue); +} diff --git a/src/methods/hasIn.js b/src/methods/hasIn.js new file mode 100644 index 0000000000..704dc5c80f --- /dev/null +++ b/src/methods/hasIn.js @@ -0,0 +1,5 @@ +import { hasIn as _hasIn } from '../functional/hasIn'; + +export function hasIn(searchKeyPath) { + return _hasIn(this, searchKeyPath); +} diff --git a/src/methods/merge.js b/src/methods/merge.js new file mode 100644 index 0000000000..427f7c466c --- /dev/null +++ b/src/methods/merge.js @@ -0,0 +1,51 @@ +import { KeyedCollection } from '../Collection'; +import { NOT_SET } from '../TrieUtils'; +import { update } from '../functional/update'; +import { isRecord } from '../predicates/isRecord'; + +export function merge(...iters) { + return mergeIntoKeyedWith(this, iters); +} + +export function mergeWith(merger, ...iters) { + if (typeof merger !== 'function') { + throw new TypeError('Invalid merger function: ' + merger); + } + return mergeIntoKeyedWith(this, iters, merger); +} + +function mergeIntoKeyedWith(collection, collections, merger) { + const iters = []; + for (let ii = 0; ii < collections.length; ii++) { + const collection = KeyedCollection(collections[ii]); + if (collection.size !== 0) { + iters.push(collection); + } + } + if (iters.length === 0) { + return collection; + } + if ( + collection.toSeq().size === 0 && + !collection.__ownerID && + iters.length === 1 + ) { + return isRecord(collection) + ? collection // Record is empty and will not be updated: return the same instance + : collection.constructor(iters[0]); + } + return collection.withMutations((collection) => { + const mergeIntoCollection = merger + ? (value, key) => { + update(collection, key, NOT_SET, (oldVal) => + oldVal === NOT_SET ? value : merger(oldVal, value, key) + ); + } + : (value, key) => { + collection.set(key, value); + }; + for (let ii = 0; ii < iters.length; ii++) { + iters[ii].forEach(mergeIntoCollection); + } + }); +} diff --git a/src/methods/mergeDeep.js b/src/methods/mergeDeep.js new file mode 100644 index 0000000000..e2238f664c --- /dev/null +++ b/src/methods/mergeDeep.js @@ -0,0 +1,9 @@ +import { mergeDeepWithSources } from '../functional/merge'; + +export function mergeDeep(...iters) { + return mergeDeepWithSources(this, iters); +} + +export function mergeDeepWith(merger, ...iters) { + return mergeDeepWithSources(this, iters, merger); +} diff --git a/src/methods/mergeDeepIn.js b/src/methods/mergeDeepIn.js new file mode 100644 index 0000000000..119369b7ba --- /dev/null +++ b/src/methods/mergeDeepIn.js @@ -0,0 +1,9 @@ +import { mergeDeepWithSources } from '../functional/merge'; +import { updateIn } from '../functional/updateIn'; +import { emptyMap } from '../Map'; + +export function mergeDeepIn(keyPath, ...iters) { + return updateIn(this, keyPath, emptyMap(), (m) => + mergeDeepWithSources(m, iters) + ); +} diff --git a/src/methods/mergeIn.js b/src/methods/mergeIn.js new file mode 100644 index 0000000000..9af239c4d0 --- /dev/null +++ b/src/methods/mergeIn.js @@ -0,0 +1,7 @@ +import { mergeWithSources } from '../functional/merge'; +import { updateIn } from '../functional/updateIn'; +import { emptyMap } from '../Map'; + +export function mergeIn(keyPath, ...iters) { + return updateIn(this, keyPath, emptyMap(), (m) => mergeWithSources(m, iters)); +} diff --git a/src/methods/setIn.js b/src/methods/setIn.js new file mode 100644 index 0000000000..3ea05b89d6 --- /dev/null +++ b/src/methods/setIn.js @@ -0,0 +1,5 @@ +import { setIn as _setIn } from '../functional/setIn'; + +export function setIn(keyPath, v) { + return _setIn(this, keyPath, v); +} diff --git a/src/methods/toObject.js b/src/methods/toObject.js new file mode 100644 index 0000000000..fb927f0e48 --- /dev/null +++ b/src/methods/toObject.js @@ -0,0 +1,10 @@ +import assertNotInfinite from '../utils/assertNotInfinite'; + +export function toObject() { + assertNotInfinite(this.size); + const object = {}; + this.__iterate((v, k) => { + object[k] = v; + }); + return object; +} diff --git a/src/methods/update.js b/src/methods/update.js new file mode 100644 index 0000000000..0d533f7037 --- /dev/null +++ b/src/methods/update.js @@ -0,0 +1,7 @@ +import { update as _update } from '../functional/update'; + +export function update(key, notSetValue, updater) { + return arguments.length === 1 + ? key(this) + : _update(this, key, notSetValue, updater); +} diff --git a/src/methods/updateIn.js b/src/methods/updateIn.js new file mode 100644 index 0000000000..8df1860868 --- /dev/null +++ b/src/methods/updateIn.js @@ -0,0 +1,5 @@ +import { updateIn as _updateIn } from '../functional/updateIn'; + +export function updateIn(keyPath, notSetValue, updater) { + return _updateIn(this, keyPath, notSetValue, updater); +} diff --git a/src/methods/wasAltered.js b/src/methods/wasAltered.js new file mode 100644 index 0000000000..165a3e3ab2 --- /dev/null +++ b/src/methods/wasAltered.js @@ -0,0 +1,3 @@ +export function wasAltered() { + return this.__altered; +} diff --git a/src/methods/withMutations.js b/src/methods/withMutations.js new file mode 100644 index 0000000000..59c5cc83dc --- /dev/null +++ b/src/methods/withMutations.js @@ -0,0 +1,5 @@ +export function withMutations(fn) { + const mutable = this.asMutable(); + fn(mutable); + return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this; +} diff --git a/src/predicates/isAssociative.ts b/src/predicates/isAssociative.ts new file mode 100644 index 0000000000..e174616f7b --- /dev/null +++ b/src/predicates/isAssociative.ts @@ -0,0 +1,25 @@ +import { isKeyed } from './isKeyed'; +import { isIndexed } from './isIndexed'; +import type { Collection } from '../../type-definitions/immutable'; + +/** + * True if `maybeAssociative` is either a Keyed or Indexed Collection. + * + * ```js + * import { isAssociative, Map, List, Stack, Set } from 'immutable'; + * + * isAssociative([]); // false + * isAssociative({}); // false + * isAssociative(Map()); // true + * isAssociative(List()); // true + * isAssociative(Stack()); // true + * isAssociative(Set()); // false + * ``` + */ +export function isAssociative( + maybeAssociative: unknown +): maybeAssociative is + | Collection.Keyed + | Collection.Indexed { + return isKeyed(maybeAssociative) || isIndexed(maybeAssociative); +} diff --git a/src/predicates/isCollection.ts b/src/predicates/isCollection.ts new file mode 100644 index 0000000000..738a4614e0 --- /dev/null +++ b/src/predicates/isCollection.ts @@ -0,0 +1,27 @@ +import type { Collection } from '../../type-definitions/immutable'; + +// Note: value is unchanged to not break immutable-devtools. +export const IS_COLLECTION_SYMBOL = '@@__IMMUTABLE_ITERABLE__@@'; + +/** + * True if `maybeCollection` is a Collection, or any of its subclasses. + * + * ```js + * import { isCollection, Map, List, Stack } from 'immutable'; + * + * isCollection([]); // false + * isCollection({}); // false + * isCollection(Map()); // true + * isCollection(List()); // true + * isCollection(Stack()); // true + * ``` + */ +export function isCollection( + maybeCollection: unknown +): maybeCollection is Collection { + return Boolean( + maybeCollection && + // @ts-expect-error: maybeCollection is typed as `{}`, need to change in 6.0 to `maybeCollection && typeof maybeCollection === 'object' && IS_COLLECTION_SYMBOL in maybeCollection` + maybeCollection[IS_COLLECTION_SYMBOL] + ); +} diff --git a/src/predicates/isImmutable.ts b/src/predicates/isImmutable.ts new file mode 100644 index 0000000000..d01bd03afb --- /dev/null +++ b/src/predicates/isImmutable.ts @@ -0,0 +1,24 @@ +import type { Collection, Record } from '../../type-definitions/immutable'; +import { isCollection } from './isCollection'; +import { isRecord } from './isRecord'; + +/** + * True if `maybeImmutable` is an Immutable Collection or Record. + * + * Note: Still returns true even if the collections is within a `withMutations()`. + * + * ```js + * import { isImmutable, Map, List, Stack } from 'immutable'; + * isImmutable([]); // false + * isImmutable({}); // false + * isImmutable(Map()); // true + * isImmutable(List()); // true + * isImmutable(Stack()); // true + * isImmutable(Map().asMutable()); // true + * ``` + */ +export function isImmutable( + maybeImmutable: unknown +): maybeImmutable is Collection | Record { + return isCollection(maybeImmutable) || isRecord(maybeImmutable); +} diff --git a/src/predicates/isIndexed.ts b/src/predicates/isIndexed.ts new file mode 100644 index 0000000000..3e20595af5 --- /dev/null +++ b/src/predicates/isIndexed.ts @@ -0,0 +1,27 @@ +import type { Collection } from '../../type-definitions/immutable'; + +export const IS_INDEXED_SYMBOL = '@@__IMMUTABLE_INDEXED__@@'; + +/** + * True if `maybeIndexed` is a Collection.Indexed, or any of its subclasses. + * + * ```js + * import { isIndexed, Map, List, Stack, Set } from 'immutable'; + * + * isIndexed([]); // false + * isIndexed({}); // false + * isIndexed(Map()); // false + * isIndexed(List()); // true + * isIndexed(Stack()); // true + * isIndexed(Set()); // false + * ``` + */ +export function isIndexed( + maybeIndexed: unknown +): maybeIndexed is Collection.Indexed { + return Boolean( + maybeIndexed && + // @ts-expect-error: maybeIndexed is typed as `{}`, need to change in 6.0 to `maybeIndexed && typeof maybeIndexed === 'object' && IS_INDEXED_SYMBOL in maybeIndexed` + maybeIndexed[IS_INDEXED_SYMBOL] + ); +} diff --git a/src/predicates/isKeyed.ts b/src/predicates/isKeyed.ts new file mode 100644 index 0000000000..35f7b7e9c8 --- /dev/null +++ b/src/predicates/isKeyed.ts @@ -0,0 +1,26 @@ +import type { Collection } from '../../type-definitions/immutable'; + +export const IS_KEYED_SYMBOL = '@@__IMMUTABLE_KEYED__@@'; + +/** + * True if `maybeKeyed` is a Collection.Keyed, or any of its subclasses. + * + * ```js + * import { isKeyed, Map, List, Stack } from 'immutable'; + * + * isKeyed([]); // false + * isKeyed({}); // false + * isKeyed(Map()); // true + * isKeyed(List()); // false + * isKeyed(Stack()); // false + * ``` + */ +export function isKeyed( + maybeKeyed: unknown +): maybeKeyed is Collection.Keyed { + return Boolean( + maybeKeyed && + // @ts-expect-error: maybeKeyed is typed as `{}`, need to change in 6.0 to `maybeKeyed && typeof maybeKeyed === 'object' && IS_KEYED_SYMBOL in maybeKeyed` + maybeKeyed[IS_KEYED_SYMBOL] + ); +} diff --git a/src/predicates/isList.ts b/src/predicates/isList.ts new file mode 100644 index 0000000000..080427eb2a --- /dev/null +++ b/src/predicates/isList.ts @@ -0,0 +1,14 @@ +import type { List } from '../../type-definitions/immutable'; + +export const IS_LIST_SYMBOL = '@@__IMMUTABLE_LIST__@@'; + +/** + * True if `maybeList` is a List. + */ +export function isList(maybeList: unknown): maybeList is List { + return Boolean( + maybeList && + // @ts-expect-error: maybeList is typed as `{}`, need to change in 6.0 to `maybeList && typeof maybeList === 'object' && IS_LIST_SYMBOL in maybeList` + maybeList[IS_LIST_SYMBOL] + ); +} diff --git a/src/predicates/isMap.ts b/src/predicates/isMap.ts new file mode 100644 index 0000000000..ef96c7e138 --- /dev/null +++ b/src/predicates/isMap.ts @@ -0,0 +1,16 @@ +import type { Map } from '../../type-definitions/immutable'; + +export const IS_MAP_SYMBOL = '@@__IMMUTABLE_MAP__@@'; + +/** + * True if `maybeMap` is a Map. + * + * Also true for OrderedMaps. + */ +export function isMap(maybeMap: unknown): maybeMap is Map { + return Boolean( + maybeMap && + // @ts-expect-error: maybeMap is typed as `{}`, need to change in 6.0 to `maybeMap && typeof maybeMap === 'object' && IS_MAP_SYMBOL in maybeMap` + maybeMap[IS_MAP_SYMBOL] + ); +} diff --git a/src/predicates/isOrdered.ts b/src/predicates/isOrdered.ts new file mode 100644 index 0000000000..2e20d415ff --- /dev/null +++ b/src/predicates/isOrdered.ts @@ -0,0 +1,31 @@ +import type { OrderedCollection } from '../../type-definitions/immutable'; + +export const IS_ORDERED_SYMBOL = '@@__IMMUTABLE_ORDERED__@@'; + +/** + * True if `maybeOrdered` is a Collection where iteration order is well + * defined. True for Collection.Indexed as well as OrderedMap and OrderedSet. + * + * ```js + * import { isOrdered, Map, OrderedMap, List, Set } from 'immutable'; + * + * isOrdered([]); // false + * isOrdered({}); // false + * isOrdered(Map()); // false + * isOrdered(OrderedMap()); // true + * isOrdered(List()); // true + * isOrdered(Set()); // false + * ``` + */ +export function isOrdered( + maybeOrdered: Iterable +): maybeOrdered is OrderedCollection; +export function isOrdered( + maybeOrdered: unknown +): maybeOrdered is OrderedCollection { + return Boolean( + maybeOrdered && + // @ts-expect-error: maybeOrdered is typed as `{}`, need to change in 6.0 to `maybeOrdered && typeof maybeOrdered === 'object' && IS_ORDERED_SYMBOL in maybeOrdered` + maybeOrdered[IS_ORDERED_SYMBOL] + ); +} diff --git a/src/predicates/isOrderedMap.ts b/src/predicates/isOrderedMap.ts new file mode 100644 index 0000000000..ac56e200b5 --- /dev/null +++ b/src/predicates/isOrderedMap.ts @@ -0,0 +1,12 @@ +import type { OrderedMap } from '../../type-definitions/immutable'; +import { isMap } from './isMap'; +import { isOrdered } from './isOrdered'; + +/** + * True if `maybeOrderedMap` is an OrderedMap. + */ +export function isOrderedMap( + maybeOrderedMap: unknown +): maybeOrderedMap is OrderedMap { + return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap); +} diff --git a/src/predicates/isOrderedSet.ts b/src/predicates/isOrderedSet.ts new file mode 100644 index 0000000000..8ac58beb96 --- /dev/null +++ b/src/predicates/isOrderedSet.ts @@ -0,0 +1,12 @@ +import { isSet } from './isSet'; +import { isOrdered } from './isOrdered'; +import type { OrderedSet } from '../../type-definitions/immutable'; + +/** + * True if `maybeOrderedSet` is an OrderedSet. + */ +export function isOrderedSet( + maybeOrderedSet: unknown +): maybeOrderedSet is OrderedSet { + return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet); +} diff --git a/src/predicates/isRecord.ts b/src/predicates/isRecord.ts new file mode 100644 index 0000000000..ff9b1cdde8 --- /dev/null +++ b/src/predicates/isRecord.ts @@ -0,0 +1,14 @@ +import type { Record } from '../../type-definitions/immutable'; + +export const IS_RECORD_SYMBOL = '@@__IMMUTABLE_RECORD__@@'; + +/** + * True if `maybeRecord` is a Record. + */ +export function isRecord(maybeRecord: unknown): maybeRecord is Record { + return Boolean( + maybeRecord && + // @ts-expect-error: maybeRecord is typed as `{}`, need to change in 6.0 to `maybeRecord && typeof maybeRecord === 'object' && IS_RECORD_SYMBOL in maybeRecord` + maybeRecord[IS_RECORD_SYMBOL] + ); +} diff --git a/src/predicates/isSeq.ts b/src/predicates/isSeq.ts new file mode 100644 index 0000000000..1b0f26f04a --- /dev/null +++ b/src/predicates/isSeq.ts @@ -0,0 +1,19 @@ +import type { Seq } from '../../type-definitions/immutable'; + +export const IS_SEQ_SYMBOL = '@@__IMMUTABLE_SEQ__@@'; + +/** + * True if `maybeSeq` is a Seq. + */ +export function isSeq( + maybeSeq: unknown +): maybeSeq is + | Seq.Indexed + | Seq.Keyed + | Seq.Set { + return Boolean( + maybeSeq && + // @ts-expect-error: maybeSeq is typed as `{}`, need to change in 6.0 to `maybeSeq && typeof maybeSeq === 'object' && MAYBE_SEQ_SYMBOL in maybeSeq` + maybeSeq[IS_SEQ_SYMBOL] + ); +} diff --git a/src/predicates/isSet.ts b/src/predicates/isSet.ts new file mode 100644 index 0000000000..a9a59fe71c --- /dev/null +++ b/src/predicates/isSet.ts @@ -0,0 +1,16 @@ +import type { Set } from '../../type-definitions/immutable'; + +export const IS_SET_SYMBOL = '@@__IMMUTABLE_SET__@@'; + +/** + * True if `maybeSet` is a Set. + * + * Also true for OrderedSets. + */ +export function isSet(maybeSet: unknown): maybeSet is Set { + return Boolean( + maybeSet && + // @ts-expect-error: maybeSet is typed as `{}`, need to change in 6.0 to `maybeSeq && typeof maybeSet === 'object' && MAYBE_SET_SYMBOL in maybeSet` + maybeSet[IS_SET_SYMBOL] + ); +} diff --git a/src/predicates/isStack.ts b/src/predicates/isStack.ts new file mode 100644 index 0000000000..b62768f88e --- /dev/null +++ b/src/predicates/isStack.ts @@ -0,0 +1,14 @@ +import type { Stack } from '../../type-definitions/immutable'; + +export const IS_STACK_SYMBOL = '@@__IMMUTABLE_STACK__@@'; + +/** + * True if `maybeStack` is a Stack. + */ +export function isStack(maybeStack: unknown): maybeStack is Stack { + return Boolean( + maybeStack && + // @ts-expect-error: maybeStack is typed as `{}`, need to change in 6.0 to `maybeStack && typeof maybeStack === 'object' && MAYBE_STACK_SYMBOL in maybeStack` + maybeStack[IS_STACK_SYMBOL] + ); +} diff --git a/src/predicates/isValueObject.ts b/src/predicates/isValueObject.ts new file mode 100644 index 0000000000..f603b517ea --- /dev/null +++ b/src/predicates/isValueObject.ts @@ -0,0 +1,18 @@ +import type { ValueObject } from '../../type-definitions/immutable'; + +/** + * True if `maybeValue` is a JavaScript Object which has *both* `equals()` + * and `hashCode()` methods. + * + * Any two instances of *value objects* can be compared for value equality with + * `Immutable.is()` and can be used as keys in a `Map` or members in a `Set`. + */ +export function isValueObject(maybeValue: unknown): maybeValue is ValueObject { + return Boolean( + maybeValue && + // @ts-expect-error: maybeValue is typed as `{}` + typeof maybeValue.equals === 'function' && + // @ts-expect-error: maybeValue is typed as `{}` + typeof maybeValue.hashCode === 'function' + ); +} diff --git a/src/toJS.js b/src/toJS.js new file mode 100644 index 0000000000..2d820416c8 --- /dev/null +++ b/src/toJS.js @@ -0,0 +1,28 @@ +import { Seq } from './Seq'; +import { isCollection } from './predicates/isCollection'; +import { isKeyed } from './predicates/isKeyed'; +import isDataStructure from './utils/isDataStructure'; + +export function toJS(value) { + if (!value || typeof value !== 'object') { + return value; + } + if (!isCollection(value)) { + if (!isDataStructure(value)) { + return value; + } + value = Seq(value); + } + if (isKeyed(value)) { + const result = {}; + value.__iterate((v, k) => { + result[k] = toJS(v); + }); + return result; + } + const result = []; + value.__iterate((v) => { + result.push(toJS(v)); + }); + return result; +} diff --git a/src/utils/arrCopy.ts b/src/utils/arrCopy.ts new file mode 100644 index 0000000000..e6cc653f98 --- /dev/null +++ b/src/utils/arrCopy.ts @@ -0,0 +1,12 @@ +// http://jsperf.com/copy-array-inline + +export default function arrCopy(arr: Array, offset?: number): Array { + offset = offset || 0; + const len = Math.max(0, arr.length - offset); + const newArr: Array = new Array(len); + for (let ii = 0; ii < len; ii++) { + // @ts-expect-error We may want to guard for undefined values with `if (arr[ii + offset] !== undefined`, but ths should not happen by design + newArr[ii] = arr[ii + offset]; + } + return newArr; +} diff --git a/src/utils/assertNotInfinite.js b/src/utils/assertNotInfinite.js deleted file mode 100644 index aace777ba1..0000000000 --- a/src/utils/assertNotInfinite.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import invariant from './invariant' - -export default function assertNotInfinite(size) { - invariant( - size !== Infinity, - 'Cannot perform this action with an infinite size.' - ); -} diff --git a/src/utils/assertNotInfinite.ts b/src/utils/assertNotInfinite.ts new file mode 100644 index 0000000000..52abc8fc4c --- /dev/null +++ b/src/utils/assertNotInfinite.ts @@ -0,0 +1,8 @@ +import invariant from './invariant'; + +export default function assertNotInfinite(size: number): void { + invariant( + size !== Infinity, + 'Cannot perform this action with an infinite size.' + ); +} diff --git a/src/utils/coerceKeyPath.ts b/src/utils/coerceKeyPath.ts new file mode 100644 index 0000000000..843981f0ea --- /dev/null +++ b/src/utils/coerceKeyPath.ts @@ -0,0 +1,15 @@ +import type { KeyPath } from '../../type-definitions/immutable'; +import { isOrdered } from '../predicates/isOrdered'; +import isArrayLike from './isArrayLike'; + +export default function coerceKeyPath(keyPath: KeyPath): ArrayLike { + if (isArrayLike(keyPath) && typeof keyPath !== 'string') { + return keyPath; + } + if (isOrdered(keyPath)) { + return keyPath.toArray(); + } + throw new TypeError( + 'Invalid keyPath: expected Ordered Collection or Array: ' + keyPath + ); +} diff --git a/src/utils/createClass.js b/src/utils/createClass.js deleted file mode 100644 index 8f59cf42b4..0000000000 --- a/src/utils/createClass.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -export default function createClass(ctor, superClass) { - if (superClass) { - ctor.prototype = Object.create(superClass.prototype); - } - ctor.prototype.constructor = ctor; -} diff --git a/src/utils/deepEqual.js b/src/utils/deepEqual.js deleted file mode 100644 index cc2074206d..0000000000 --- a/src/utils/deepEqual.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { is } from '../is' -import { NOT_SET } from '../TrieUtils' -import { isIterable, isKeyed, isIndexed, isAssociative, isOrdered } from '../Iterable' - -export default function deepEqual(a, b) { - if (a === b) { - return true; - } - - if ( - !isIterable(b) || - a.size !== undefined && b.size !== undefined && a.size !== b.size || - a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash || - isKeyed(a) !== isKeyed(b) || - isIndexed(a) !== isIndexed(b) || - isOrdered(a) !== isOrdered(b) - ) { - return false; - } - - if (a.size === 0 && b.size === 0) { - return true; - } - - var notAssociative = !isAssociative(a); - - if (isOrdered(a)) { - var entries = a.entries(); - return b.every((v, k) => { - var entry = entries.next().value; - return entry && is(entry[1], v) && (notAssociative || is(entry[0], k)); - }) && entries.next().done; - } - - var flipped = false; - - if (a.size === undefined) { - if (b.size === undefined) { - if (typeof a.cacheResult === 'function') { - a.cacheResult(); - } - } else { - flipped = true; - var _ = a; - a = b; - b = _; - } - } - - var allEqual = true; - var bSize = b.__iterate((v, k) => { - if (notAssociative ? !a.has(v) : - flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) { - allEqual = false; - return false; - } - }); - - return allEqual && a.size === bSize; -} diff --git a/src/utils/deepEqual.ts b/src/utils/deepEqual.ts new file mode 100644 index 0000000000..c76d62c840 --- /dev/null +++ b/src/utils/deepEqual.ts @@ -0,0 +1,97 @@ +import { is } from '../is'; +import { NOT_SET } from '../TrieUtils'; +import { isCollection } from '../predicates/isCollection'; +import { isKeyed } from '../predicates/isKeyed'; +import { isIndexed } from '../predicates/isIndexed'; +import { isAssociative } from '../predicates/isAssociative'; +import { isOrdered } from '../predicates/isOrdered'; +import type { Collection } from '../../type-definitions/immutable'; +import type { Repeat } from '../Repeat'; +import type { Range } from '../Range'; + +export default function deepEqual( + a: Range | Repeat | Collection, + b: unknown +): boolean { + if (a === b) { + return true; + } + + if ( + !isCollection(b) || + // @ts-expect-error size should exists on Collection + (a.size !== undefined && b.size !== undefined && a.size !== b.size) || + // @ts-expect-error __hash exists on Collection + (a.__hash !== undefined && + // @ts-expect-error __hash exists on Collection + b.__hash !== undefined && + // @ts-expect-error __hash exists on Collection + a.__hash !== b.__hash) || + isKeyed(a) !== isKeyed(b) || + isIndexed(a) !== isIndexed(b) || + // @ts-expect-error Range extends Collection, which implements [Symbol.iterator], so it is valid + isOrdered(a) !== isOrdered(b) + ) { + return false; + } + + // @ts-expect-error size should exists on Collection + if (a.size === 0 && b.size === 0) { + return true; + } + + const notAssociative = !isAssociative(a); + + // @ts-expect-error Range extends Collection, which implements [Symbol.iterator], so it is valid + if (isOrdered(a)) { + const entries = a.entries(); + // @ts-expect-error need to cast as boolean + return ( + b.every((v, k) => { + const entry = entries.next().value; + return entry && is(entry[1], v) && (notAssociative || is(entry[0], k)); + }) && entries.next().done + ); + } + + let flipped = false; + + if (a.size === undefined) { + // @ts-expect-error size should exists on Collection + if (b.size === undefined) { + if (typeof a.cacheResult === 'function') { + a.cacheResult(); + } + } else { + flipped = true; + const _ = a; + a = b; + b = _; + } + } + + let allEqual = true; + const bSize: number = + // @ts-expect-error b is Range | Repeat | Collection as it may have been flipped, and __iterate is valid + b.__iterate((v, k) => { + if ( + notAssociative + ? // @ts-expect-error has exists on Collection + !a.has(v) + : flipped + ? // @ts-expect-error type of `get` does not "catch" the version with `notSetValue` + !is(v, a.get(k, NOT_SET)) + : // @ts-expect-error type of `get` does not "catch" the version with `notSetValue` + !is(a.get(k, NOT_SET), v) + ) { + allEqual = false; + return false; + } + }); + + return ( + allEqual && + // @ts-expect-error size should exists on Collection + a.size === bSize + ); +} diff --git a/src/utils/forceIterator.js b/src/utils/forceIterator.js deleted file mode 100644 index 845aa06a07..0000000000 --- a/src/utils/forceIterator.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -import { Iterable } from '../Iterable' -import { getIterator } from '../Iterator' -import isArrayLike from './isArrayLike' - -export default function forceIterator(keyPath) { - var iter = getIterator(keyPath); - if (!iter) { - // Array might not be iterable in this environment, so we need a fallback - // to our wrapped type. - if (!isArrayLike(keyPath)) { - throw new TypeError('Expected iterable or array-like: ' + keyPath); - } - iter = getIterator(Iterable(keyPath)); - } - return iter; -} diff --git a/src/utils/hasOwnProperty.ts b/src/utils/hasOwnProperty.ts new file mode 100644 index 0000000000..cb5ba22368 --- /dev/null +++ b/src/utils/hasOwnProperty.ts @@ -0,0 +1 @@ +export default Object.prototype.hasOwnProperty; diff --git a/src/utils/invariant.js b/src/utils/invariant.js deleted file mode 100644 index 867c8ae786..0000000000 --- a/src/utils/invariant.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -export default function invariant(condition, error) { - if (!condition) throw new Error(error); -} diff --git a/src/utils/invariant.ts b/src/utils/invariant.ts new file mode 100644 index 0000000000..958e6c977b --- /dev/null +++ b/src/utils/invariant.ts @@ -0,0 +1,6 @@ +export default function invariant( + condition: unknown, + error: string +): asserts condition { + if (!condition) throw new Error(error); +} diff --git a/src/utils/isArrayLike.js b/src/utils/isArrayLike.js deleted file mode 100644 index 9283c72fb0..0000000000 --- a/src/utils/isArrayLike.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -export default function isArrayLike(value) { - return value && typeof value.length === 'number'; -} diff --git a/src/utils/isArrayLike.ts b/src/utils/isArrayLike.ts new file mode 100644 index 0000000000..82659d6c54 --- /dev/null +++ b/src/utils/isArrayLike.ts @@ -0,0 +1,25 @@ +export default function isArrayLike( + value: unknown +): value is ArrayLike { + if (Array.isArray(value) || typeof value === 'string') { + return true; + } + + // @ts-expect-error "Type 'unknown' is not assignable to type 'boolean'" : convert to Boolean + return ( + value && + typeof value === 'object' && + // @ts-expect-error check that `'length' in value &&` + Number.isInteger(value.length) && + // @ts-expect-error check that `'length' in value &&` + value.length >= 0 && + // @ts-expect-error check that `'length' in value &&` + (value.length === 0 + ? // Only {length: 0} is considered Array-like. + Object.keys(value).length === 1 + : // An object is only Array-like if it has a property where the last value + // in the array-like may be found (which could be undefined). + // @ts-expect-error check that `'length' in value &&` + value.hasOwnProperty(value.length - 1)) + ); +} diff --git a/src/utils/isDataStructure.ts b/src/utils/isDataStructure.ts new file mode 100644 index 0000000000..e71c55bb7d --- /dev/null +++ b/src/utils/isDataStructure.ts @@ -0,0 +1,20 @@ +import type { Collection, Record } from '../../type-definitions/immutable'; +import { isImmutable } from '../predicates/isImmutable'; +import isPlainObj from './isPlainObj'; + +/** + * Returns true if the value is a potentially-persistent data structure, either + * provided by Immutable.js or a plain Array or Object. + */ +export default function isDataStructure( + value: unknown +): value is + | Collection + | Record + | Array + | object { + return ( + typeof value === 'object' && + (isImmutable(value) || Array.isArray(value) || isPlainObj(value)) + ); +} diff --git a/src/utils/isPlainObj.ts b/src/utils/isPlainObj.ts new file mode 100644 index 0000000000..07e73e208a --- /dev/null +++ b/src/utils/isPlainObj.ts @@ -0,0 +1,26 @@ +const toString = Object.prototype.toString; + +export default function isPlainObject(value: unknown): value is object { + // The base prototype's toString deals with Argument objects and native namespaces like Math + if ( + !value || + typeof value !== 'object' || + toString.call(value) !== '[object Object]' + ) { + return false; + } + + const proto = Object.getPrototypeOf(value); + if (proto === null) { + return true; + } + + // Iteratively going up the prototype chain is needed for cross-realm environments (differing contexts, iframes, etc) + let parentProto = proto; + let nextProto = Object.getPrototypeOf(proto); + while (nextProto !== null) { + parentProto = nextProto; + nextProto = Object.getPrototypeOf(parentProto); + } + return parentProto === proto; +} diff --git a/src/utils/mixin.js b/src/utils/mixin.js deleted file mode 100644 index cff365086d..0000000000 --- a/src/utils/mixin.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -/** - * Contributes additional methods to a constructor - */ -export default function mixin(ctor, methods) { - var keyCopier = key => { ctor.prototype[key] = methods[key]; }; - Object.keys(methods).forEach(keyCopier); - Object.getOwnPropertySymbols && - Object.getOwnPropertySymbols(methods).forEach(keyCopier); - return ctor; -} diff --git a/src/utils/mixin.ts b/src/utils/mixin.ts new file mode 100644 index 0000000000..3d4cee5fc6 --- /dev/null +++ b/src/utils/mixin.ts @@ -0,0 +1,20 @@ +type Constructor = new (...args: unknown[]) => T; + +/** + * Contributes additional methods to a constructor + */ +export default function mixin( + ctor: C, + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type + methods: Record +): C { + const keyCopier = (key: string | symbol): void => { + // @ts-expect-error how to handle symbol ? + ctor.prototype[key] = methods[key]; + }; + Object.keys(methods).forEach(keyCopier); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- TODO enable eslint here + Object.getOwnPropertySymbols && + Object.getOwnPropertySymbols(methods).forEach(keyCopier); + return ctor; +} diff --git a/src/utils/quoteString.ts b/src/utils/quoteString.ts new file mode 100644 index 0000000000..8d9b825a38 --- /dev/null +++ b/src/utils/quoteString.ts @@ -0,0 +1,11 @@ +/** + * Converts a value to a string, adding quotes if a string was provided. + */ +export default function quoteString(value: unknown): string { + try { + return typeof value === 'string' ? JSON.stringify(value) : String(value); + // eslint-disable-next-line @typescript-eslint/no-unused-vars + } catch (_ignoreError) { + return JSON.stringify(value); + } +} diff --git a/src/utils/shallowCopy.ts b/src/utils/shallowCopy.ts new file mode 100644 index 0000000000..37aad28015 --- /dev/null +++ b/src/utils/shallowCopy.ts @@ -0,0 +1,19 @@ +import arrCopy from './arrCopy'; +import hasOwnProperty from './hasOwnProperty'; + +export default function shallowCopy(from: Array): Array; +export default function shallowCopy(from: O): O; +export default function shallowCopy( + from: Array | O +): Array | O { + if (Array.isArray(from)) { + return arrCopy(from); + } + const to: Partial = {}; + for (const key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + return to as O; +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000000..b0fa1baad1 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + /* Base Options: */ + "esModuleInterop": true, + "skipLibCheck": true, + "target": "es2022", + "allowJs": true, + "resolveJsonModule": true, + "moduleDetection": "force", + "isolatedModules": true, + "verbatimModuleSyntax": true, + /* Strictness */ + "strict": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, + /* If NOT transpiling with TypeScript: */ + "module": "ESNext", + "moduleResolution": "bundler", + "noEmit": true, + /* If your code runs in the DOM: */ + "lib": ["es2022", "dom", "dom.iterable"] + } +} diff --git a/tsconfig.src.json b/tsconfig.src.json new file mode 100644 index 0000000000..ae550d9ff2 --- /dev/null +++ b/tsconfig.src.json @@ -0,0 +1,4 @@ +{ + "extends": "./tsconfig.json", + "include": ["src/Immutable.js"] +} diff --git a/tstyche.config.json b/tstyche.config.json new file mode 100644 index 0000000000..903317e015 --- /dev/null +++ b/tstyche.config.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://tstyche.org/schemas/config.json", + "testFileMatch": [ + "type-definitions/ts-tests/*.ts" + ] +} diff --git a/type-definitions/Immutable.d.ts b/type-definitions/Immutable.d.ts deleted file mode 100644 index 93bcad66e7..0000000000 --- a/type-definitions/Immutable.d.ts +++ /dev/null @@ -1,2460 +0,0 @@ -/** - * Copyright (c) 2014-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -/** - * Immutable data encourages pure functions (data-in, data-out) and lends itself - * to much simpler application development and enabling techniques from - * functional programming such as lazy evaluation. - * - * While designed to bring these powerful functional concepts to JavaScript, it - * presents an Object-Oriented API familiar to Javascript engineers and closely - * mirroring that of Array, Map, and Set. It is easy and efficient to convert to - * and from plain Javascript types. - - * Note: all examples are presented in [ES6][]. To run in all browsers, they - * need to be translated to ES3. For example: - * - * // ES6 - * foo.map(x => x * x); - * // ES3 - * foo.map(function (x) { return x * x; }); - * - * [ES6]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla - */ - -declare module 'immutable' { - - /** - * Deeply converts plain JS objects and arrays to Immutable Maps and Lists. - * - * If a `reviver` is optionally provided, it will be called with every - * collection as a Seq (beginning with the most nested collections - * and proceeding to the top-level collection itself), along with the key - * refering to each collection and the parent JS object provided as `this`. - * For the top level, object, the key will be `""`. This `reviver` is expected - * to return a new Immutable Iterable, allowing for custom convertions from - * deep JS objects. - * - * This example converts JSON to List and OrderedMap: - * - * Immutable.fromJS({a: {b: [10, 20, 30]}, c: 40}, function (key, value) { - * var isIndexed = Immutable.Iterable.isIndexed(value); - * return isIndexed ? value.toList() : value.toOrderedMap(); - * }); - * - * // true, "b", {b: [10, 20, 30]} - * // false, "a", {a: {b: [10, 20, 30]}, c: 40} - * // false, "", {"": {a: {b: [10, 20, 30]}, c: 40}} - * - * If `reviver` is not provided, the default behavior will convert Arrays into - * Lists and Objects into Maps. - * - * `reviver` acts similarly to the [same parameter in `JSON.parse`][1]. - * - * `Immutable.fromJS` is conservative in it's conversion. It will only convert - * arrays which pass `Array.isArray` to Lists, and only raw objects (no custom - * prototype) to Map. - * - * [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter - * "Using the reviver parameter" - */ - export function fromJS( - json: any, - reviver?: (k: any, v: Iterable) => any - ): any; - - - /** - * Value equality check with semantics similar to `Object.is`, but treats - * Immutable `Iterable`s as values, equal if the second `Iterable` includes - * equivalent values. - * - * It's used throughout Immutable when checking for equality, including `Map` - * key equality and `Set` membership. - * - * var map1 = Immutable.Map({a:1, b:1, c:1}); - * var map2 = Immutable.Map({a:1, b:1, c:1}); - * assert(map1 !== map2); - * assert(Object.is(map1, map2) === false); - * assert(Immutable.is(map1, map2) === true); - * - * Note: Unlike `Object.is`, `Immutable.is` assumes `0` and `-0` are the same - * value, matching the behavior of ES6 Map key equality. - */ - export function is(first: any, second: any): boolean; - - - /** - * Lists are ordered indexed dense collections, much like a JavaScript - * Array. - * - * Lists are immutable and fully persistent with O(log32 N) gets and sets, - * and O(1) push and pop. - * - * Lists implement Deque, with efficient addition and removal from both the - * end (`push`, `pop`) and beginning (`unshift`, `shift`). - * - * Unlike a JavaScript Array, there is no distinction between an - * "unset" index and an index set to `undefined`. `List#forEach` visits all - * indices from 0 to size, regardless of if they where explicitly defined. - */ - export module List { - - /** - * True if the provided value is a List - */ - function isList(maybeList: any): boolean; - - /** - * Creates a new List containing `values`. - */ - function of(...values: T[]): List; - } - - /** - * Create a new immutable List containing the values of the provided - * iterable-like. - */ - export function List(): List; - export function List(iter: IndexedIterable): List; - export function List(iter: SetIterable): List; - export function List(iter: KeyedIterable): List; - export function List(array: Array): List; - export function List(iterator: Iterator): List; - export function List(iterable: /*Iterable*/Object): List; - - - export interface List extends IndexedCollection { - - // Persistent changes - - /** - * Returns a new List which includes `value` at `index`. If `index` already - * exists in this List, it will be replaced. - * - * `index` may be a negative number, which indexes back from the end of the - * List. `v.set(-1, "value")` sets the last item in the List. - * - * If `index` larger than `size`, the returned List's `size` will be large - * enough to include the `index`. - */ - set(index: number, value: T): List; - - /** - * Returns a new List which excludes this `index` and with a size 1 less - * than this List. Values at indicies above `index` are shifted down by 1 to - * fill the position. - * - * This is synonymous with `list.splice(index, 1)`. - * - * `index` may be a negative number, which indexes back from the end of the - * List. `v.delete(-1)` deletes the last item in the List. - * - * Note: `delete` cannot be safely used in IE8 - * @alias remove - */ - delete(index: number): List; - remove(index: number): List; - - /** - * Returns a new List with 0 size and no values. - */ - clear(): List; - - /** - * Returns a new List with the provided `values` appended, starting at this - * List's `size`. - */ - push(...values: T[]): List; - - /** - * Returns a new List with a size ones less than this List, excluding - * the last index in this List. - * - * Note: this differs from `Array#pop` because it returns a new - * List rather than the removed value. Use `last()` to get the last value - * in this List. - */ - pop(): List; - - /** - * Returns a new List with the provided `values` prepended, shifting other - * values ahead to higher indices. - */ - unshift(...values: T[]): List; - - /** - * Returns a new List with a size ones less than this List, excluding - * the first index in this List, shifting all other values to a lower index. - * - * Note: this differs from `Array#shift` because it returns a new - * List rather than the removed value. Use `first()` to get the first - * value in this List. - */ - shift(): List; - - /** - * Returns a new List with an updated value at `index` with the return - * value of calling `updater` with the existing value, or `notSetValue` if - * `index` was not set. If called with a single argument, `updater` is - * called with the List itself. - * - * `index` may be a negative number, which indexes back from the end of the - * List. `v.update(-1)` updates the last item in the List. - * - * @see `Map#update` - */ - update(updater: (value: List) => List): List; - update(index: number, updater: (value: T) => T): List; - update(index: number, notSetValue: T, updater: (value: T) => T): List; - - /** - * @see `Map#merge` - */ - merge(...iterables: IndexedIterable[]): List; - merge(...iterables: Array[]): List; - - /** - * @see `Map#mergeWith` - */ - mergeWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: IndexedIterable[] - ): List; - mergeWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: Array[] - ): List; - - /** - * @see `Map#mergeDeep` - */ - mergeDeep(...iterables: IndexedIterable[]): List; - mergeDeep(...iterables: Array[]): List; - - /** - * @see `Map#mergeDeepWith` - */ - mergeDeepWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: IndexedIterable[] - ): List; - mergeDeepWith( - merger: (previous?: T, next?: T, key?: number) => T, - ...iterables: Array[] - ): List; - - /** - * Returns a new List with size `size`. If `size` is less than this - * List's size, the new List will exclude values at the higher indices. - * If `size` is greater than this List's size, the new List will have - * undefined values for the newly available indices. - * - * When building a new List and the final size is known up front, `setSize` - * used in conjunction with `withMutations` may result in the more - * performant construction. - */ - setSize(size: number): List; - - - // Deep persistent changes - - /** - * Returns a new List having set `value` at this `keyPath`. If any keys in - * `keyPath` do not exist, a new immutable Map will be created at that key. - * - * Index numbers are used as keys to determine the path to follow in - * the List. - */ - setIn(keyPath: Array, value: any): List; - setIn(keyPath: Iterable, value: any): List; - - /** - * Returns a new List having removed the value at this `keyPath`. If any - * keys in `keyPath` do not exist, no change will occur. - * - * @alias removeIn - */ - deleteIn(keyPath: Array): List; - deleteIn(keyPath: Iterable): List; - removeIn(keyPath: Array): List; - removeIn(keyPath: Iterable): List; - - /** - * @see `Map#updateIn` - */ - updateIn( - keyPath: Array, - updater: (value: any) => any - ): List; - updateIn( - keyPath: Array, - notSetValue: any, - updater: (value: any) => any - ): List; - updateIn( - keyPath: Iterable, - updater: (value: any) => any - ): List; - updateIn( - keyPath: Iterable, - notSetValue: any, - updater: (value: any) => any - ): List; - - /** - * @see `Map#mergeIn` - */ - mergeIn( - keyPath: Iterable, - ...iterables: IndexedIterable[] - ): List; - mergeIn( - keyPath: Array, - ...iterables: IndexedIterable[] - ): List; - mergeIn( - keyPath: Array, - ...iterables: Array[] - ): List; - - /** - * @see `Map#mergeDeepIn` - */ - mergeDeepIn( - keyPath: Iterable, - ...iterables: IndexedIterable[] - ): List; - mergeDeepIn( - keyPath: Array, - ...iterables: IndexedIterable[] - ): List; - mergeDeepIn( - keyPath: Array, - ...iterables: Array[] - ): List; - - - // Transient changes - - /** - * @see `Map#withMutations` - */ - withMutations(mutator: (mutable: List) => any): List; - - /** - * @see `Map#asMutable` - */ - asMutable(): List; - - /** - * @see `Map#asImmutable` - */ - asImmutable(): List; - } - - - /** - * Immutable Map is an unordered KeyedIterable of (key, value) pairs with - * `O(log32 N)` gets and `O(log32 N)` persistent sets. - * - * Iteration order of a Map is undefined, however is stable. Multiple - * iterations of the same Map will iterate in the same order. - * - * Map's keys can be of any type, and use `Immutable.is` to determine key - * equality. This allows the use of any value (including NaN) as a key. - * - * Because `Immutable.is` returns equality based on value semantics, and - * Immutable collections are treated as values, any Immutable collection may - * be used as a key. - * - * Map().set(List.of(1), 'listofone').get(List.of(1)); - * // 'listofone' - * - * Any JavaScript object may be used as a key, however strict identity is used - * to evaluate key equality. Two similar looking objects will represent two - * different keys. - * - * Implemented by a hash-array mapped trie. - */ - export module Map { - - /** - * True if the provided value is a Map - */ - function isMap(maybeMap: any): boolean; - } - - /** - * Creates a new Immutable Map. - * - * Created with the same key value pairs as the provided KeyedIterable or - * JavaScript Object or expects an Iterable of [K, V] tuple entries. - * - * var newMap = Map({key: "value"}); - * var newMap = Map([["key", "value"]]); - * - */ - export function Map(): Map; - export function Map(iter: KeyedIterable): Map; - export function Map(iter: Iterable>): Map; - export function Map(array: Array>): Map; - export function Map(obj: {[key: string]: V}): Map; - export function Map(iterator: Iterator>): Map; - export function Map(iterable: /*Iterable<[K,V]>*/Object): Map; - - export interface Map extends KeyedCollection { - - // Persistent changes - - /** - * Returns a new Map also containing the new key, value pair. If an equivalent - * key already exists in this Map, it will be replaced. - */ - set(key: K, value: V): Map; - - /** - * Returns a new Map which excludes this `key`. - * - * Note: `delete` cannot be safely used in IE8, but is provided to mirror - * the ES6 collection API. - * @alias remove - */ - delete(key: K): Map; - remove(key: K): Map; - - /** - * Returns a new Map containing no keys or values. - */ - clear(): Map; - - /** - * Returns a new Map having updated the value at this `key` with the return - * value of calling `updater` with the existing value, or `notSetValue` if - * the key was not set. If called with only a single argument, `updater` is - * called with the Map itself. - * - * Equivalent to: `map.set(key, updater(map.get(key, notSetValue)))`. - */ - update(updater: (value: Map) => Map): Map; - update(key: K, updater: (value: V) => V): Map; - update(key: K, notSetValue: V, updater: (value: V) => V): Map; - - /** - * Returns a new Map resulting from merging the provided Iterables - * (or JS objects) into this Map. In other words, this takes each entry of - * each iterable and sets it on this Map. - * - * If any of the values provided to `merge` are not Iterable (would return - * false for `Immutable.isIterable`) then they are deeply converted via - * `Immutable.fromJS` before being merged. However, if the value is an - * Iterable but includes non-iterable JS objects or arrays, those nested - * values will be preserved. - * - * var x = Immutable.Map({a: 10, b: 20, c: 30}); - * var y = Immutable.Map({b: 40, a: 50, d: 60}); - * x.merge(y) // { a: 50, b: 40, c: 30, d: 60 } - * y.merge(x) // { b: 20, a: 10, d: 60, c: 30 } - * - */ - merge(...iterables: Iterable[]): Map; - merge(...iterables: {[key: string]: V}[]): Map; - - /** - * Like `merge()`, `mergeWith()` returns a new Map resulting from merging - * the provided Iterables (or JS objects) into this Map, but uses the - * `merger` function for dealing with conflicts. - * - * var x = Immutable.Map({a: 10, b: 20, c: 30}); - * var y = Immutable.Map({b: 40, a: 50, d: 60}); - * x.mergeWith((prev, next) => prev / next, y) // { a: 0.2, b: 0.5, c: 30, d: 60 } - * y.mergeWith((prev, next) => prev / next, x) // { b: 2, a: 5, d: 60, c: 30 } - * - */ - mergeWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: Iterable[] - ): Map; - mergeWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: {[key: string]: V}[] - ): Map; - - /** - * Like `merge()`, but when two Iterables conflict, it merges them as well, - * recursing deeply through the nested data. - * - * var x = Immutable.fromJS({a: { x: 10, y: 10 }, b: { x: 20, y: 50 } }); - * var y = Immutable.fromJS({a: { x: 2 }, b: { y: 5 }, c: { z: 3 } }); - * x.mergeDeep(y) // {a: { x: 2, y: 10 }, b: { x: 20, y: 5 }, c: { z: 3 } } - * - */ - mergeDeep(...iterables: Iterable[]): Map; - mergeDeep(...iterables: {[key: string]: V}[]): Map; - - /** - * Like `mergeDeep()`, but when two non-Iterables conflict, it uses the - * `merger` function to determine the resulting value. - * - * var x = Immutable.fromJS({a: { x: 10, y: 10 }, b: { x: 20, y: 50 } }); - * var y = Immutable.fromJS({a: { x: 2 }, b: { y: 5 }, c: { z: 3 } }); - * x.mergeDeepWith((prev, next) => prev / next, y) - * // {a: { x: 5, y: 10 }, b: { x: 20, y: 10 }, c: { z: 3 } } - * - */ - mergeDeepWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: Iterable[] - ): Map; - mergeDeepWith( - merger: (previous?: V, next?: V, key?: K) => V, - ...iterables: {[key: string]: V}[] - ): Map; - - - // Deep persistent changes - - /** - * Returns a new Map having set `value` at this `keyPath`. If any keys in - * `keyPath` do not exist, a new immutable Map will be created at that key. - */ - setIn(keyPath: Array, value: any): Map; - setIn(KeyPath: Iterable, value: any): Map; - - /** - * Returns a new Map having removed the value at this `keyPath`. If any keys - * in `keyPath` do not exist, no change will occur. - * - * @alias removeIn - */ - deleteIn(keyPath: Array): Map; - deleteIn(keyPath: Iterable): Map; - removeIn(keyPath: Array): Map; - removeIn(keyPath: Iterable): Map; - - /** - * Returns a new Map having applied the `updater` to the entry found at the - * keyPath. - * - * If any keys in `keyPath` do not exist, new Immutable `Map`s will - * be created at those keys. If the `keyPath` does not already contain a - * value, the `updater` function will be called with `notSetValue`, if - * provided, otherwise `undefined`. - * - * var data = Immutable.fromJS({ a: { b: { c: 10 } } }); - * data = data.updateIn(['a', 'b', 'c'], val => val * 2); - * // { a: { b: { c: 20 } } } - * - * If the `updater` function returns the same value it was called with, then - * no change will occur. This is still true if `notSetValue` is provided. - * - * var data1 = Immutable.fromJS({ a: { b: { c: 10 } } }); - * data2 = data1.updateIn(['x', 'y', 'z'], 100, val => val); - * assert(data2 === data1); - * - */ - updateIn( - keyPath: Array, - updater: (value: any) => any - ): Map; - updateIn( - keyPath: Array, - notSetValue: any, - updater: (value: any) => any - ): Map; - updateIn( - keyPath: Iterable, - updater: (value: any) => any - ): Map; - updateIn( - keyPath: Iterable, - notSetValue: any, - updater: (value: any) => any - ): Map; - - /** - * A combination of `updateIn` and `merge`, returning a new Map, but - * performing the merge at a point arrived at by following the keyPath. - * In other words, these two lines are equivalent: - * - * x.updateIn(['a', 'b', 'c'], abc => abc.merge(y)); - * x.mergeIn(['a', 'b', 'c'], y); - * - */ - mergeIn( - keyPath: Iterable, - ...iterables: Iterable[] - ): Map; - mergeIn( - keyPath: Array, - ...iterables: Iterable[] - ): Map; - mergeIn( - keyPath: Array, - ...iterables: {[key: string]: V}[] - ): Map; - - /** - * A combination of `updateIn` and `mergeDeep`, returning a new Map, but - * performing the deep merge at a point arrived at by following the keyPath. - * In other words, these two lines are equivalent: - * - * x.updateIn(['a', 'b', 'c'], abc => abc.mergeDeep(y)); - * x.mergeDeepIn(['a', 'b', 'c'], y); - * - */ - mergeDeepIn( - keyPath: Iterable, - ...iterables: Iterable[] - ): Map; - mergeDeepIn( - keyPath: Array, - ...iterables: Iterable[] - ): Map; - mergeDeepIn( - keyPath: Array, - ...iterables: {[key: string]: V}[] - ): Map; - - - // Transient changes - - /** - * Every time you call one of the above functions, a new immutable Map is - * created. If a pure function calls a number of these to produce a final - * return value, then a penalty on performance and memory has been paid by - * creating all of the intermediate immutable Maps. - * - * If you need to apply a series of mutations to produce a new immutable - * Map, `withMutations()` creates a temporary mutable copy of the Map which - * can apply mutations in a highly performant manner. In fact, this is - * exactly how complex mutations like `merge` are done. - * - * As an example, this results in the creation of 2, not 4, new Maps: - * - * var map1 = Immutable.Map(); - * var map2 = map1.withMutations(map => { - * map.set('a', 1).set('b', 2).set('c', 3); - * }); - * assert(map1.size === 0); - * assert(map2.size === 3); - * - */ - withMutations(mutator: (mutable: Map) => any): Map; - - /** - * Another way to avoid creation of intermediate Immutable maps is to create - * a mutable copy of this collection. Mutable copies *always* return `this`, - * and thus shouldn't be used for equality. Your function should never return - * a mutable copy of a collection, only use it internally to create a new - * collection. If possible, use `withMutations` as it provides an easier to - * use API. - * - * Note: if the collection is already mutable, `asMutable` returns itself. - */ - asMutable(): Map; - - /** - * The yin to `asMutable`'s yang. Because it applies to mutable collections, - * this operation is *mutable* and returns itself. Once performed, the mutable - * copy has become immutable and can be safely returned from a function. - */ - asImmutable(): Map; - } - - - /** - * A type of Map that has the additional guarantee that the iteration order of - * entries will be the order in which they were set(). - * - * The iteration behavior of OrderedMap is the same as native ES6 Map and - * JavaScript Object. - * - * Note that `OrderedMap` are more expensive than non-ordered `Map` and may - * consume more memory. `OrderedMap#set` is amortized O(log32 N), but not - * stable. - */ - - export module OrderedMap { - - /** - * True if the provided value is an OrderedMap. - */ - function isOrderedMap(maybeOrderedMap: any): boolean; - } - - /** - * Creates a new Immutable OrderedMap. - * - * Created with the same key value pairs as the provided KeyedIterable or - * JavaScript Object or expects an Iterable of [K, V] tuple entries. - * - * The iteration order of key-value pairs provided to this constructor will - * be preserved in the OrderedMap. - * - * var newOrderedMap = OrderedMap({key: "value"}); - * var newOrderedMap = OrderedMap([["key", "value"]]); - * - */ - export function OrderedMap(): OrderedMap; - export function OrderedMap(iter: KeyedIterable): OrderedMap; - export function OrderedMap(iter: Iterable>): OrderedMap; - export function OrderedMap(array: Array>): OrderedMap; - export function OrderedMap(obj: {[key: string]: V}): OrderedMap; - export function OrderedMap(iterator: Iterator>): OrderedMap; - export function OrderedMap(iterable: /*Iterable<[K,V]>*/Object): OrderedMap; - - export interface OrderedMap extends Map {} - - - /** - * A Collection of unique values with `O(log32 N)` adds and has. - * - * When iterating a Set, the entries will be (value, value) pairs. Iteration - * order of a Set is undefined, however is stable. Multiple iterations of the - * same Set will iterate in the same order. - * - * Set values, like Map keys, may be of any type. Equality is determined using - * `Immutable.is`, enabling Sets to uniquely include other Immutable - * collections, custom value types, and NaN. - */ - export module Set { - - /** - * True if the provided value is a Set - */ - function isSet(maybeSet: any): boolean; - - /** - * Creates a new Set containing `values`. - */ - function of(...values: T[]): Set; - - /** - * `Set.fromKeys()` creates a new immutable Set containing the keys from - * this Iterable or JavaScript Object. - */ - function fromKeys(iter: Iterable): Set; - function fromKeys(obj: {[key: string]: any}): Set; - } - - /** - * Create a new immutable Set containing the values of the provided - * iterable-like. - */ - export function Set(): Set; - export function Set(iter: SetIterable): Set; - export function Set(iter: IndexedIterable): Set; - export function Set(iter: KeyedIterable): Set; - export function Set(array: Array): Set; - export function Set(iterator: Iterator): Set; - export function Set(iterable: /*Iterable*/Object): Set; - - export interface Set extends SetCollection { - - // Persistent changes - - /** - * Returns a new Set which also includes this value. - */ - add(value: T): Set; - - /** - * Returns a new Set which excludes this value. - * - * Note: `delete` cannot be safely used in IE8 - * @alias remove - */ - delete(value: T): Set; - remove(value: T): Set; - - /** - * Returns a new Set containing no values. - */ - clear(): Set; - - /** - * Returns a Set including any value from `iterables` that does not already - * exist in this Set. - * @alias merge - */ - union(...iterables: Iterable[]): Set; - union(...iterables: Array[]): Set; - merge(...iterables: Iterable[]): Set; - merge(...iterables: Array[]): Set; - - - /** - * Returns a Set which has removed any values not also contained - * within `iterables`. - */ - intersect(...iterables: Iterable[]): Set; - intersect(...iterables: Array[]): Set; - - /** - * Returns a Set excluding any values contained within `iterables`. - */ - subtract(...iterables: Iterable[]): Set; - subtract(...iterables: Array[]): Set; - - - // Transient changes - - /** - * @see `Map#withMutations` - */ - withMutations(mutator: (mutable: Set) => any): Set; - - /** - * @see `Map#asMutable` - */ - asMutable(): Set; - - /** - * @see `Map#asImmutable` - */ - asImmutable(): Set; - } - - - /** - * A type of Set that has the additional guarantee that the iteration order of - * values will be the order in which they were `add`ed. - * - * The iteration behavior of OrderedSet is the same as native ES6 Set. - * - * Note that `OrderedSet` are more expensive than non-ordered `Set` and may - * consume more memory. `OrderedSet#add` is amortized O(log32 N), but not - * stable. - */ - export module OrderedSet { - - /** - * True if the provided value is an OrderedSet. - */ - function isOrderedSet(maybeOrderedSet: any): boolean; - - /** - * Creates a new OrderedSet containing `values`. - */ - function of(...values: T[]): OrderedSet; - - /** - * `OrderedSet.fromKeys()` creates a new immutable OrderedSet containing - * the keys from this Iterable or JavaScript Object. - */ - function fromKeys(iter: Iterable): OrderedSet; - function fromKeys(obj: {[key: string]: any}): OrderedSet; - } - - /** - * Create a new immutable OrderedSet containing the values of the provided - * iterable-like. - */ - export function OrderedSet(): OrderedSet; - export function OrderedSet(iter: SetIterable): OrderedSet; - export function OrderedSet(iter: IndexedIterable): OrderedSet; - export function OrderedSet(iter: KeyedIterable): OrderedSet; - export function OrderedSet(array: Array): OrderedSet; - export function OrderedSet(iterator: Iterator): OrderedSet; - export function OrderedSet(iterable: /*Iterable*/Object): OrderedSet; - - export interface OrderedSet extends Set {} - - - /** - * Stacks are indexed collections which support very efficient O(1) addition - * and removal from the front using `unshift(v)` and `shift()`. - * - * For familiarity, Stack also provides `push(v)`, `pop()`, and `peek()`, but - * be aware that they also operate on the front of the list, unlike List or - * a JavaScript Array. - * - * Note: `reverse()` or any inherent reverse traversal (`reduceRight`, - * `lastIndexOf`, etc.) is not efficient with a Stack. - * - * Stack is implemented with a Single-Linked List. - */ - export module Stack { - - /** - * True if the provided value is a Stack - */ - function isStack(maybeStack: any): boolean; - - /** - * Creates a new Stack containing `values`. - */ - function of(...values: T[]): Stack; - } - - /** - * Create a new immutable Stack containing the values of the provided - * iterable-like. - * - * The iteration order of the provided iterable is preserved in the - * resulting `Stack`. - */ - export function Stack(): Stack; - export function Stack(iter: IndexedIterable): Stack; - export function Stack(iter: SetIterable): Stack; - export function Stack(iter: KeyedIterable): Stack; - export function Stack(array: Array): Stack; - export function Stack(iterator: Iterator): Stack; - export function Stack(iterable: /*Iterable*/Object): Stack; - - export interface Stack extends IndexedCollection { - - // Reading values - - /** - * Alias for `Stack.first()`. - */ - peek(): T; - - - // Persistent changes - - /** - * Returns a new Stack with 0 size and no values. - */ - clear(): Stack; - - /** - * Returns a new Stack with the provided `values` prepended, shifting other - * values ahead to higher indices. - * - * This is very efficient for Stack. - */ - unshift(...values: T[]): Stack; - - /** - * Like `Stack#unshift`, but accepts a iterable rather than varargs. - */ - unshiftAll(iter: Iterable): Stack; - unshiftAll(iter: Array): Stack; - - /** - * Returns a new Stack with a size ones less than this Stack, excluding - * the first item in this Stack, shifting all other values to a lower index. - * - * Note: this differs from `Array#shift` because it returns a new - * Stack rather than the removed value. Use `first()` or `peek()` to get the - * first value in this Stack. - */ - shift(): Stack; - - /** - * Alias for `Stack#unshift` and is not equivalent to `List#push`. - */ - push(...values: T[]): Stack; - - /** - * Alias for `Stack#unshiftAll`. - */ - pushAll(iter: Iterable): Stack; - pushAll(iter: Array): Stack; - - /** - * Alias for `Stack#shift` and is not equivalent to `List#pop`. - */ - pop(): Stack; - - - // Transient changes - - /** - * @see `Map#withMutations` - */ - withMutations(mutator: (mutable: Stack) => any): Stack; - - /** - * @see `Map#asMutable` - */ - asMutable(): Stack; - - /** - * @see `Map#asImmutable` - */ - asImmutable(): Stack; - } - - - /** - * Returns a IndexedSeq of numbers from `start` (inclusive) to `end` - * (exclusive), by `step`, where `start` defaults to 0, `step` to 1, and `end` to - * infinity. When `start` is equal to `end`, returns empty range. - * - * Range() // [0,1,2,3,...] - * Range(10) // [10,11,12,13,...] - * Range(10,15) // [10,11,12,13,14] - * Range(10,30,5) // [10,15,20,25] - * Range(30,10,5) // [30,25,20,15] - * Range(30,30,5) // [] - * - */ - export function Range(start?: number, end?: number, step?: number): IndexedSeq; - - - /** - * Returns a IndexedSeq of `value` repeated `times` times. When `times` is - * not defined, returns an infinite `Seq` of `value`. - * - * Repeat('foo') // ['foo','foo','foo',...] - * Repeat('bar',4) // ['bar','bar','bar','bar'] - * - */ - export function Repeat(value: T, times?: number): IndexedSeq; - - - /** - * Creates a new Class which produces Record instances. A record is similar to - * a JS object, but enforce a specific set of allowed string keys, and have - * default values. - * - * var ABRecord = Record({a:1, b:2}) - * var myRecord = new ABRecord({b:3}) - * - * Records always have a value for the keys they define. `remove`ing a key - * from a record simply resets it to the default value for that key. - * - * myRecord.size // 2 - * myRecord.get('a') // 1 - * myRecord.get('b') // 3 - * myRecordWithoutB = myRecord.remove('b') - * myRecordWithoutB.get('b') // 2 - * myRecordWithoutB.size // 2 - * - * Values provided to the constructor not found in the Record type will - * be ignored: - * - * var myRecord = new ABRecord({b:3, x:10}) - * myRecord.get('x') // undefined - * - * Because Records have a known set of string keys, property get access works - * as expected, however property sets will throw an Error. - * - * Note: IE8 does not support property access. Only use `get()` when - * supporting IE8. - * - * myRecord.b // 3 - * myRecord.b = 5 // throws Error - * - * Record Classes can be extended as well, allowing for custom methods on your - * Record. This is not a common pattern in functional environments, but is in - * many JS programs. - * - * Note: TypeScript does not support this type of subclassing. - * - * class ABRecord extends Record({a:1,b:2}) { - * getAB() { - * return this.a + this.b; - * } - * } - * - * var myRecord = new ABRecord(b:3) - * myRecord.getAB() // 4 - * - */ - export module Record { - interface Class { - new (): Map; - new (values: {[key: string]: any}): Map; - new (values: Iterable): Map; // deprecated - - (): Map; - (values: {[key: string]: any}): Map; - (values: Iterable): Map; // deprecated - } - } - - export function Record( - defaultValues: {[key: string]: any}, name?: string - ): Record.Class; - - - /** - * Represents a sequence of values, but may not be backed by a concrete data - * structure. - * - * **Seq is immutable** — Once a Seq is created, it cannot be - * changed, appended to, rearranged or otherwise modified. Instead, any - * mutative method called on a `Seq` will return a new `Seq`. - * - * **Seq is lazy** — Seq does as little work as necessary to respond to any - * method call. Values are often created during iteration, including implicit - * iteration when reducing or converting to a concrete data structure such as - * a `List` or JavaScript `Array`. - * - * For example, the following performs no work, because the resulting - * Seq's values are never iterated: - * - * var oddSquares = Immutable.Seq.of(1,2,3,4,5,6,7,8) - * .filter(x => x % 2).map(x => x * x); - * - * Once the Seq is used, it performs only the work necessary. In this - * example, no intermediate data structures are ever created, filter is only - * called three times, and map is only called twice: - * - * console.log(evenSquares.get(1)); // 9 - * - * Seq allows for the efficient chaining of operations, - * allowing for the expression of logic that can otherwise be very tedious: - * - * Immutable.Seq({a:1, b:1, c:1}) - * .flip().map(key => key.toUpperCase()).flip().toObject(); - * // Map { A: 1, B: 1, C: 1 } - * - * As well as expressing logic that would otherwise be memory or time limited: - * - * Immutable.Range(1, Infinity) - * .skip(1000) - * .map(n => -n) - * .filter(n => n % 2 === 0) - * .take(2) - * .reduce((r, n) => r * n, 1); - * // 1006008 - * - * Seq is often used to provide a rich collection API to JavaScript Object. - * - * Immutable.Seq({ x: 0, y: 1, z: 2 }).map(v => v * 2).toObject(); - * // { x: 0, y: 2, z: 4 } - */ - - export module Seq { - /** - * True if `maybeSeq` is a Seq, it is not backed by a concrete - * structure such as Map, List, or Set. - */ - function isSeq(maybeSeq: any): boolean; - - /** - * Returns a Seq of the values provided. Alias for `IndexedSeq.of()`. - */ - function of(...values: T[]): IndexedSeq; - } - - /** - * Creates a Seq. - * - * Returns a particular kind of `Seq` based on the input. - * - * * If a `Seq`, that same `Seq`. - * * If an `Iterable`, a `Seq` of the same kind (Keyed, Indexed, or Set). - * * If an Array-like, an `IndexedSeq`. - * * If an Object with an Iterator, an `IndexedSeq`. - * * If an Iterator, an `IndexedSeq`. - * * If an Object, a `KeyedSeq`. - * - */ - export function Seq(): Seq; - export function Seq(seq: Seq): Seq; - export function Seq(iterable: Iterable): Seq; - export function Seq(array: Array): IndexedSeq; - export function Seq(obj: {[key: string]: V}): KeyedSeq; - export function Seq(iterator: Iterator): IndexedSeq; - export function Seq(iterable: /*ES6Iterable*/Object): IndexedSeq; - - export interface Seq extends Iterable { - - /** - * Some Seqs can describe their size lazily. When this is the case, - * size will be an integer. Otherwise it will be undefined. - * - * For example, Seqs returned from `map()` or `reverse()` - * preserve the size of the original `Seq` while `filter()` does not. - * - * Note: `Range`, `Repeat` and `Seq`s made from `Array`s and `Object`s will - * always have a size. - */ - size: number/*?*/; - - - // Force evaluation - - /** - * Because Sequences are lazy and designed to be chained together, they do - * not cache their results. For example, this map function is called a total - * of 6 times, as each `join` iterates the Seq of three values. - * - * var squares = Seq.of(1,2,3).map(x => x * x); - * squares.join() + squares.join(); - * - * If you know a `Seq` will be used multiple times, it may be more - * efficient to first cache it in memory. Here, the map function is called - * only 3 times. - * - * var squares = Seq.of(1,2,3).map(x => x * x).cacheResult(); - * squares.join() + squares.join(); - * - * Use this method judiciously, as it must fully evaluate a Seq which can be - * a burden on memory and possibly performance. - * - * Note: after calling `cacheResult`, a Seq will always have a `size`. - */ - cacheResult(): /*this*/Seq; - } - - - /** - * `Seq` which represents key-value pairs. - */ - export module KeyedSeq {} - - /** - * Always returns a KeyedSeq, if input is not keyed, expects an - * iterable of [K, V] tuples. - */ - export function KeyedSeq(): KeyedSeq; - export function KeyedSeq(seq: KeyedIterable): KeyedSeq; - export function KeyedSeq(seq: Iterable): KeyedSeq; - export function KeyedSeq(array: Array): KeyedSeq; - export function KeyedSeq(obj: {[key: string]: V}): KeyedSeq; - export function KeyedSeq(iterator: Iterator): KeyedSeq; - export function KeyedSeq(iterable: /*Iterable<[K,V]>*/Object): KeyedSeq; - - export interface KeyedSeq extends Seq, KeyedIterable { - - /** - * Returns itself - */ - toSeq(): /*this*/KeyedSeq - } - - - /** - * `Seq` which represents an ordered indexed list of values. - */ - export module IndexedSeq { - - /** - * Provides an IndexedSeq of the values provided. - */ - function of(...values: T[]): IndexedSeq; - } - - /** - * Always returns IndexedSeq, discarding associated keys and - * supplying incrementing indices. - */ - export function IndexedSeq(): IndexedSeq; - export function IndexedSeq(seq: IndexedIterable): IndexedSeq; - export function IndexedSeq(seq: SetIterable): IndexedSeq; - export function IndexedSeq(seq: KeyedIterable): IndexedSeq; - export function IndexedSeq(array: Array): IndexedSeq; - export function IndexedSeq(iterator: Iterator): IndexedSeq; - export function IndexedSeq(iterable: /*Iterable*/Object): IndexedSeq; - - export interface IndexedSeq extends Seq, IndexedIterable { - - /** - * Returns itself - */ - toSeq(): /*this*/IndexedSeq - } - - /** - * `Seq` which represents a set of values. - * - * Because `Seq` are often lazy, `SetSeq` does not provide the same guarantee - * of value uniqueness as the concrete `Set`. - */ - export module SetSeq { - - /** - * Returns a SetSeq of the provided values - */ - function of(...values: T[]): SetSeq; - } - - /** - * Always returns a SetSeq, discarding associated indices or keys. - */ - export function SetSeq(): SetSeq; - export function SetSeq(seq: SetIterable): SetSeq; - export function SetSeq(seq: IndexedIterable): SetSeq; - export function SetSeq(seq: KeyedIterable): SetSeq; - export function SetSeq(array: Array): SetSeq; - export function SetSeq(iterator: Iterator): SetSeq; - export function SetSeq(iterable: /*Iterable*/Object): SetSeq; - - export interface SetSeq extends Seq, SetIterable { - - /** - * Returns itself - */ - toSeq(): /*this*/SetSeq - } - - - /** - * The `Iterable` is a set of (key, value) entries which can be iterated, and - * is the base class for all collections in `immutable`, allowing them to - * make use of all the Iterable methods (such as `map` and `filter`). - * - * Note: An iterable is always iterated in the same order, however that order - * may not always be well defined, as is the case for the `Map` and `Set`. - */ - export module Iterable { - /** - * True if `maybeIterable` is an Iterable, or any of its subclasses. - */ - function isIterable(maybeIterable: any): boolean; - - /** - * True if `maybeKeyed` is a KeyedIterable, or any of its subclasses. - */ - function isKeyed(maybeKeyed: any): boolean; - - /** - * True if `maybeIndexed` is a IndexedIterable, or any of its subclasses. - */ - function isIndexed(maybeIndexed: any): boolean; - - /** - * True if `maybeAssociative` is either a keyed or indexed Iterable. - */ - function isAssociative(maybeAssociative: any): boolean; - - /** - * True if `maybeOrdered` is an Iterable where iteration order is well - * defined. True for IndexedIterable as well as OrderedMap and OrderedSet. - */ - function isOrdered(maybeOrdered: any): boolean; - } - - /** - * Creates an Iterable. - * - * The type of Iterable created is based on the input. - * - * * If an `Iterable`, that same `Iterable`. - * * If an Array-like, an `IndexedIterable`. - * * If an Object with an Iterator, an `IndexedIterable`. - * * If an Iterator, an `IndexedIterable`. - * * If an Object, a `KeyedIterable`. - * - * This methods forces the conversion of Objects and Strings to Iterables. - * If you want to ensure that a Iterable of one item is returned, use - * `Seq.of`. - */ - export function Iterable(iterable: Iterable): Iterable; - export function Iterable(array: Array): IndexedIterable; - export function Iterable(obj: {[key: string]: V}): KeyedIterable; - export function Iterable(iterator: Iterator): IndexedIterable; - export function Iterable(iterable: /*ES6Iterable*/Object): IndexedIterable; - export function Iterable(value: V): IndexedIterable; - - export interface Iterable { - - // Value equality - - /** - * True if this and the other Iterable have value equality, as defined - * by `Immutable.is()`. - * - * Note: This is equivalent to `Immutable.is(this, other)`, but provided to - * allow for chained expressions. - */ - equals(other: Iterable): boolean; - - /** - * Computes and returns the hashed identity for this Iterable. - * - * The `hashCode` of an Iterable is used to determine potential equality, - * and is used when adding this to a `Set` or as a key in a `Map`, enabling - * lookup via a different instance. - * - * var a = List.of(1, 2, 3); - * var b = List.of(1, 2, 3); - * assert(a !== b); // different instances - * var set = Set.of(a); - * assert(set.has(b) === true); - * - * If two values have the same `hashCode`, they are [not guaranteed - * to be equal][Hash Collision]. If two values have different `hashCode`s, - * they must not be equal. - * - * [Hash Collision]: http://en.wikipedia.org/wiki/Collision_(computer_science) - */ - hashCode(): number; - - - // Reading values - - /** - * Returns the value associated with the provided key, or notSetValue if - * the Iterable does not contain this key. - * - * Note: it is possible a key may be associated with an `undefined` value, - * so if `notSetValue` is not provided and this method returns `undefined`, - * that does not guarantee the key was not found. - */ - get(key: K, notSetValue?: V): V; - - /** - * True if a key exists within this `Iterable`. - */ - has(key: K): boolean; - - /** - * True if a value exists within this `Iterable`. - * @alias contains - */ - includes(value: V): boolean; - contains(value: V): boolean; - - /** - * The first value in the Iterable. - */ - first(): V; - - /** - * The last value in the Iterable. - */ - last(): V; - - - // Reading deep values - - /** - * Returns the value found by following a path of keys or indices through - * nested Iterables. - */ - getIn(searchKeyPath: Array, notSetValue?: any): any; - getIn(searchKeyPath: Iterable, notSetValue?: any): any; - - /** - * True if the result of following a path of keys or indices through nested - * Iterables results in a set value. - */ - hasIn(searchKeyPath: Array): boolean; - hasIn(searchKeyPath: Iterable): boolean; - - - // Conversion to JavaScript types - - /** - * Deeply converts this Iterable to equivalent JS. - * - * `IndexedIterables`, and `SetIterables` become Arrays, while - * `KeyedIterables` become Objects. - * - * @alias toJSON - */ - toJS(): any; - - /** - * Shallowly converts this iterable to an Array, discarding keys. - */ - toArray(): Array; - - /** - * Shallowly converts this Iterable to an Object. - * - * Throws if keys are not strings. - */ - toObject(): { [key: string]: V }; - - - // Conversion to Collections - - /** - * Converts this Iterable to a Map, Throws if keys are not hashable. - * - * Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided - * for convenience and to allow for chained expressions. - */ - toMap(): Map; - - /** - * Converts this Iterable to a Map, maintaining the order of iteration. - * - * Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but - * provided for convenience and to allow for chained expressions. - */ - toOrderedMap(): Map; - - /** - * Converts this Iterable to a Set, discarding keys. Throws if values - * are not hashable. - * - * Note: This is equivalent to `Set(this)`, but provided to allow for - * chained expressions. - */ - toSet(): Set; - - /** - * Converts this Iterable to a Set, maintaining the order of iteration and - * discarding keys. - * - * Note: This is equivalent to `OrderedSet(this.valueSeq())`, but provided - * for convenience and to allow for chained expressions. - */ - toOrderedSet(): Set; - - /** - * Converts this Iterable to a List, discarding keys. - * - * Note: This is equivalent to `List(this)`, but provided to allow - * for chained expressions. - */ - toList(): List; - - /** - * Converts this Iterable to a Stack, discarding keys. Throws if values - * are not hashable. - * - * Note: This is equivalent to `Stack(this)`, but provided to allow for - * chained expressions. - */ - toStack(): Stack; - - - // Conversion to Seq - - /** - * Converts this Iterable to a Seq of the same kind (indexed, - * keyed, or set). - */ - toSeq(): Seq; - - /** - * Returns a KeyedSeq from this Iterable where indices are treated as keys. - * - * This is useful if you want to operate on an - * IndexedIterable and preserve the [index, value] pairs. - * - * The returned Seq will have identical iteration order as - * this Iterable. - * - * Example: - * - * var indexedSeq = Immutable.Seq.of('A', 'B', 'C'); - * indexedSeq.filter(v => v === 'B').toString() // Seq [ 'B' ] - * var keyedSeq = indexedSeq.toKeyedSeq(); - * keyedSeq.filter(v => v === 'B').toString() // Seq { 1: 'B' } - * - */ - toKeyedSeq(): KeyedSeq; - - /** - * Returns an IndexedSeq of the values of this Iterable, discarding keys. - */ - toIndexedSeq(): IndexedSeq; - - /** - * Returns a SetSeq of the values of this Iterable, discarding keys. - */ - toSetSeq(): SetSeq; - - - // Iterators - - /** - * An iterator of this `Iterable`'s keys. - */ - keys(): Iterator; - - /** - * An iterator of this `Iterable`'s values. - */ - values(): Iterator; - - /** - * An iterator of this `Iterable`'s entries as `[key, value]` tuples. - */ - entries(): Iterator>; - - - // Iterables (Seq) - - /** - * Returns a new IndexedSeq of the keys of this Iterable, - * discarding values. - */ - keySeq(): IndexedSeq; - - /** - * Returns an IndexedSeq of the values of this Iterable, discarding keys. - */ - valueSeq(): IndexedSeq; - - /** - * Returns a new IndexedSeq of [key, value] tuples. - */ - entrySeq(): IndexedSeq>; - - - // Sequence algorithms - - /** - * Returns a new Iterable of the same type with values passed through a - * `mapper` function. - * - * Seq({ a: 1, b: 2 }).map(x => 10 * x) - * // Seq { a: 10, b: 20 } - * - */ - map( - mapper: (value?: V, key?: K, iter?: /*this*/Iterable) => M, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type with only the entries for which - * the `predicate` function returns true. - * - * Seq({a:1,b:2,c:3,d:4}).filter(x => x % 2 === 0) - * // Seq { b: 2, d: 4 } - * - */ - filter( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type with only the entries for which - * the `predicate` function returns false. - * - * Seq({a:1,b:2,c:3,d:4}).filterNot(x => x % 2 === 0) - * // Seq { a: 1, c: 3 } - * - */ - filterNot( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type in reverse order. - */ - reverse(): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes the same entries, - * stably sorted by using a `comparator`. - * - * If a `comparator` is not provided, a default comparator uses `<` and `>`. - * - * `comparator(valueA, valueB)`: - * - * * Returns `0` if the elements should not be swapped. - * * Returns `-1` (or any negative number) if `valueA` comes before `valueB` - * * Returns `1` (or any positive number) if `valueA` comes after `valueB` - * * Is pure, i.e. it must always return the same value for the same pair - * of values. - * - * When sorting collections which have no defined order, their ordered - * equivalents will be returned. e.g. `map.sort()` returns OrderedMap. - */ - sort(comparator?: (valueA: V, valueB: V) => number): /*this*/Iterable; - - /** - * Like `sort`, but also accepts a `comparatorValueMapper` which allows for - * sorting by more sophisticated means: - * - * hitters.sortBy(hitter => hitter.avgHits); - * - */ - sortBy( - comparatorValueMapper: (value?: V, key?: K, iter?: /*this*/Iterable) => C, - comparator?: (valueA: C, valueB: C) => number - ): /*this*/Iterable; - - /** - * Returns a `KeyedIterable` of `KeyedIterables`, grouped by the return - * value of the `grouper` function. - * - * Note: This is always an eager operation. - */ - groupBy( - grouper: (value?: V, key?: K, iter?: /*this*/Iterable) => G, - context?: any - ): /*Map*/KeyedSeq>; - - - // Side effects - - /** - * The `sideEffect` is executed for every entry in the Iterable. - * - * Unlike `Array#forEach`, if any call of `sideEffect` returns - * `false`, the iteration will stop. Returns the number of entries iterated - * (including the last iteration which returned false). - */ - forEach( - sideEffect: (value?: V, key?: K, iter?: /*this*/Iterable) => any, - context?: any - ): number; - - - // Creating subsets - - /** - * Returns a new Iterable of the same type representing a portion of this - * Iterable from start up to but not including end. - * - * If begin is negative, it is offset from the end of the Iterable. e.g. - * `slice(-2)` returns a Iterable of the last two entries. If it is not - * provided the new Iterable will begin at the beginning of this Iterable. - * - * If end is negative, it is offset from the end of the Iterable. e.g. - * `slice(0, -1)` returns an Iterable of everything but the last entry. If - * it is not provided, the new Iterable will continue through the end of - * this Iterable. - * - * If the requested slice is equivalent to the current Iterable, then it - * will return itself. - */ - slice(begin?: number, end?: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type containing all entries except - * the first. - */ - rest(): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type containing all entries except - * the last. - */ - butLast(): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which excludes the first `amount` - * entries from this Iterable. - */ - skip(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which excludes the last `amount` - * entries from this Iterable. - */ - skipLast(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries starting - * from when `predicate` first returns false. - * - * Seq.of('dog','frog','cat','hat','god') - * .skipWhile(x => x.match(/g/)) - * // Seq [ 'cat', 'hat', 'god' ] - * - */ - skipWhile( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries starting - * from when `predicate` first returns true. - * - * Seq.of('dog','frog','cat','hat','god') - * .skipUntil(x => x.match(/hat/)) - * // Seq [ 'hat', 'god' ] - * - */ - skipUntil( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes the first `amount` - * entries from this Iterable. - */ - take(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes the last `amount` - * entries from this Iterable. - */ - takeLast(amount: number): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries from this - * Iterable as long as the `predicate` returns true. - * - * Seq.of('dog','frog','cat','hat','god') - * .takeWhile(x => x.match(/o/)) - * // Seq [ 'dog', 'frog' ] - * - */ - takeWhile( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - /** - * Returns a new Iterable of the same type which includes entries from this - * Iterable as long as the `predicate` returns false. - * - * Seq.of('dog','frog','cat','hat','god').takeUntil(x => x.match(/at/)) - * // ['dog', 'frog'] - * - */ - takeUntil( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): /*this*/Iterable; - - - // Combination - - /** - * Returns a new Iterable of the same type with other values and - * iterable-like concatenated to this one. - * - * For Seqs, all entries will be present in - * the resulting iterable, even if they have the same key. - */ - concat(...valuesOrIterables: /*Array|V*/any[]): /*this*/Iterable; - - /** - * Flattens nested Iterables. - * - * Will deeply flatten the Iterable by default, returning an Iterable of the - * same type, but a `depth` can be provided in the form of a number or - * boolean (where true means to shallowly flatten one level). A depth of 0 - * (or shallow: false) will deeply flatten. - * - * Flattens only others Iterable, not Arrays or Objects. - * - * Note: `flatten(true)` operates on Iterable> and - * returns Iterable - */ - flatten(depth?: number): /*this*/Iterable; - flatten(shallow?: boolean): /*this*/Iterable; - - /** - * Flat-maps the Iterable, returning an Iterable of the same type. - * - * Similar to `iter.map(...).flatten(true)`. - */ - flatMap( - mapper: (value?: V, key?: K, iter?: /*this*/Iterable) => Iterable, - context?: any - ): /*this*/Iterable; - flatMap( - mapper: (value?: V, key?: K, iter?: /*this*/Iterable) => /*iterable-like*/any, - context?: any - ): /*this*/Iterable; - - - // Reducing a value - - /** - * Reduces the Iterable to a value by calling the `reducer` for every entry - * in the Iterable and passing along the reduced value. - * - * If `initialReduction` is not provided, or is null, the first item in the - * Iterable will be used. - * - * @see `Array#reduce`. - */ - reduce( - reducer: (reduction?: R, value?: V, key?: K, iter?: /*this*/Iterable) => R, - initialReduction?: R, - context?: any - ): R; - - /** - * Reduces the Iterable in reverse (from the right side). - * - * Note: Similar to this.reverse().reduce(), and provided for parity - * with `Array#reduceRight`. - */ - reduceRight( - reducer: (reduction?: R, value?: V, key?: K, iter?: /*this*/Iterable) => R, - initialReduction?: R, - context?: any - ): R; - - /** - * True if `predicate` returns true for all entries in the Iterable. - */ - every( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): boolean; - - /** - * True if `predicate` returns true for any entry in the Iterable. - */ - some( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): boolean; - - /** - * Joins values together as a string, inserting a separator between each. - * The default separator is `","`. - */ - join(separator?: string): string; - - /** - * Returns true if this Iterable includes no values. - * - * For some lazy `Seq`, `isEmpty` might need to iterate to determine - * emptiness. At most one iteration will occur. - */ - isEmpty(): boolean; - - /** - * Returns the size of this Iterable. - * - * Regardless of if this Iterable can describe its size lazily (some Seqs - * cannot), this method will always return the correct size. E.g. it - * evaluates a lazy `Seq` if necessary. - * - * If `predicate` is provided, then this returns the count of entries in the - * Iterable for which the `predicate` returns true. - */ - count(): number; - count( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any - ): number; - - /** - * Returns a `KeyedSeq` of counts, grouped by the return value of - * the `grouper` function. - * - * Note: This is not a lazy operation. - */ - countBy( - grouper: (value?: V, key?: K, iter?: /*this*/Iterable) => G, - context?: any - ): Map; - - - // Search for value - - /** - * Returns the value for which the `predicate` returns true. - */ - find( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): V; - - /** - * Returns the last value for which the `predicate` returns true. - * - * Note: `predicate` will be called for each entry in reverse. - */ - findLast( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): V; - - /** - * Returns the [key, value] entry for which the `predicate` returns true. - */ - findEntry( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): /*[K, V]*/Array; - - /** - * Returns the last [key, value] entry for which the `predicate` - * returns true. - * - * Note: `predicate` will be called for each entry in reverse. - */ - findLastEntry( - predicate: (value?: V, key?: K, iter?: /*this*/Iterable) => boolean, - context?: any, - notSetValue?: V - ): /*[K, V]*/Array; - - /** - * Returns the maximum value in this collection. If any values are - * comparatively equivalent, the first one found will be returned. - * - * The `comparator` is used in the same way as `Iterable#sort`. If it is not - * provided, the default comparator is `>`. - * - * When two values are considered equivalent, the first encountered will be - * returned. Otherwise, `max` will operate independent of the order of input - * as long as the comparator is commutative. The default comparator `>` is - * commutative *only* when types do not differ. - * - * If `comparator` returns 0 and either value is NaN, undefined, or null, - * that value will be returned. - */ - max(comparator?: (valueA: V, valueB: V) => number): V; - - /** - * Like `max`, but also accepts a `comparatorValueMapper` which allows for - * comparing by more sophisticated means: - * - * hitters.maxBy(hitter => hitter.avgHits); - * - */ - maxBy( - comparatorValueMapper: (value?: V, key?: K, iter?: /*this*/Iterable) => C, - comparator?: (valueA: C, valueB: C) => number - ): V; - - /** - * Returns the minimum value in this collection. If any values are - * comparatively equivalent, the first one found will be returned. - * - * The `comparator` is used in the same way as `Iterable#sort`. If it is not - * provided, the default comparator is `<`. - * - * When two values are considered equivalent, the first encountered will be - * returned. Otherwise, `min` will operate independent of the order of input - * as long as the comparator is commutative. The default comparator `<` is - * commutative *only* when types do not differ. - * - * If `comparator` returns 0 and either value is NaN, undefined, or null, - * that value will be returned. - */ - min(comparator?: (valueA: V, valueB: V) => number): V; - - /** - * Like `min`, but also accepts a `comparatorValueMapper` which allows for - * comparing by more sophisticated means: - * - * hitters.minBy(hitter => hitter.avgHits); - * - */ - minBy( - comparatorValueMapper: (value?: V, key?: K, iter?: /*this*/Iterable) => C, - comparator?: (valueA: C, valueB: C) => number - ): V; - - - // Comparison - - /** - * True if `iter` includes every value in this Iterable. - */ - isSubset(iter: Iterable): boolean; - isSubset(iter: Array): boolean; - - /** - * True if this Iterable includes every value in `iter`. - */ - isSuperset(iter: Iterable): boolean; - isSuperset(iter: Array): boolean; - - - /** - * Note: this is here as a convenience to work around an issue with - * TypeScript https://github.com/Microsoft/TypeScript/issues/285, but - * Iterable does not define `size`, instead `Seq` defines `size` as - * nullable number, and `Collection` defines `size` as always a number. - * - * @ignore - */ - size: number; - } - - - /** - * Keyed Iterables have discrete keys tied to each value. - * - * When iterating `KeyedIterable`, each iteration will yield a `[K, V]` tuple, - * in other words, `Iterable#entries` is the default iterator for Keyed - * Iterables. - */ - export module KeyedIterable {} - - /** - * Creates a KeyedIterable - * - * Similar to `Iterable()`, however it expects iterable-likes of [K, V] - * tuples if not constructed from a KeyedIterable or JS Object. - */ - export function KeyedIterable(iter: KeyedIterable): KeyedIterable; - export function KeyedIterable(iter: Iterable): KeyedIterable; - export function KeyedIterable(array: Array): KeyedIterable; - export function KeyedIterable(obj: {[key: string]: V}): KeyedIterable; - export function KeyedIterable(iterator: Iterator): KeyedIterable; - export function KeyedIterable(iterable: /*Iterable<[K,V]>*/Object): KeyedIterable; - - export interface KeyedIterable extends Iterable { - - /** - * Returns KeyedSeq. - * @override - */ - toSeq(): KeyedSeq; - - - // Sequence functions - - /** - * Returns a new KeyedIterable of the same type where the keys and values - * have been flipped. - * - * Seq({ a: 'z', b: 'y' }).flip() // { z: 'a', y: 'b' } - * - */ - flip(): /*this*/KeyedIterable; - - /** - * Returns a new KeyedIterable of the same type with keys passed through a - * `mapper` function. - * - * Seq({ a: 1, b: 2 }) - * .mapKeys(x => x.toUpperCase()) - * // Seq { A: 1, B: 2 } - * - */ - mapKeys( - mapper: (key?: K, value?: V, iter?: /*this*/KeyedIterable) => M, - context?: any - ): /*this*/KeyedIterable; - - /** - * Returns a new KeyedIterable of the same type with entries - * ([key, value] tuples) passed through a `mapper` function. - * - * Seq({ a: 1, b: 2 }) - * .mapEntries(([k, v]) => [k.toUpperCase(), v * 2]) - * // Seq { A: 2, B: 4 } - * - */ - mapEntries( - mapper: ( - entry?: /*(K, V)*/Array, - index?: number, - iter?: /*this*/KeyedIterable - ) => /*[KM, VM]*/Array, - context?: any - ): /*this*/KeyedIterable; - - - // Search for value - - /** - * Returns the key associated with the search value, or undefined. - */ - keyOf(searchValue: V): K; - - /** - * Returns the last key associated with the search value, or undefined. - */ - lastKeyOf(searchValue: V): K; - - /** - * Returns the key for which the `predicate` returns true. - */ - findKey( - predicate: (value?: V, key?: K, iter?: /*this*/KeyedIterable) => boolean, - context?: any - ): K; - - /** - * Returns the last key for which the `predicate` returns true. - * - * Note: `predicate` will be called for each entry in reverse. - */ - findLastKey( - predicate: (value?: V, key?: K, iter?: /*this*/KeyedIterable) => boolean, - context?: any - ): K; - } - - - /** - * Indexed Iterables have incrementing numeric keys. They exhibit - * slightly different behavior than `KeyedIterable` for some methods in order - * to better mirror the behavior of JavaScript's `Array`, and add methods - * which do not make sense on non-indexed Iterables such as `indexOf`. - * - * Unlike JavaScript arrays, `IndexedIterable`s are always dense. "Unset" - * indices and `undefined` indices are indistinguishable, and all indices from - * 0 to `size` are visited when iterated. - * - * All IndexedIterable methods return re-indexed Iterables. In other words, - * indices always start at 0 and increment until size. If you wish to - * preserve indices, using them as keys, convert to a KeyedIterable by calling - * `toKeyedSeq`. - */ - export module IndexedIterable {} - - /** - * Creates a new IndexedIterable. - */ - export function IndexedIterable(iter: IndexedIterable): IndexedIterable; - export function IndexedIterable(iter: SetIterable): IndexedIterable; - export function IndexedIterable(iter: KeyedIterable): IndexedIterable; - export function IndexedIterable(array: Array): IndexedIterable; - export function IndexedIterable(iterator: Iterator): IndexedIterable; - export function IndexedIterable(iterable: /*Iterable*/Object): IndexedIterable; - - export interface IndexedIterable extends Iterable { - - // Reading values - - /** - * Returns the value associated with the provided index, or notSetValue if - * the index is beyond the bounds of the Iterable. - * - * `index` may be a negative number, which indexes back from the end of the - * Iterable. `s.get(-1)` gets the last item in the Iterable. - */ - get(index: number, notSetValue?: T): T; - - - // Conversion to Seq - - /** - * Returns IndexedSeq. - * @override - */ - toSeq(): IndexedSeq; - - /** - * If this is an iterable of [key, value] entry tuples, it will return a - * KeyedSeq of those entries. - */ - fromEntrySeq(): KeyedSeq; - - - // Combination - - /** - * Returns an Iterable of the same type with `separator` between each item - * in this Iterable. - */ - interpose(separator: T): /*this*/IndexedIterable; - - /** - * Returns an Iterable of the same type with the provided `iterables` - * interleaved into this iterable. - * - * The resulting Iterable includes the first item from each, then the - * second from each, etc. - * - * I.Seq.of(1,2,3).interleave(I.Seq.of('A','B','C')) - * // Seq [ 1, 'A', 2, 'B', 3, 'C' ] - * - * The shortest Iterable stops interleave. - * - * I.Seq.of(1,2,3).interleave( - * I.Seq.of('A','B'), - * I.Seq.of('X','Y','Z') - * ) - * // Seq [ 1, 'A', 'X', 2, 'B', 'Y' ] - */ - interleave(...iterables: Array>): /*this*/IndexedIterable; - - /** - * Splice returns a new indexed Iterable by replacing a region of this - * Iterable with new values. If values are not provided, it only skips the - * region to be removed. - * - * `index` may be a negative number, which indexes back from the end of the - * Iterable. `s.splice(-2)` splices after the second to last item. - * - * Seq(['a','b','c','d']).splice(1, 2, 'q', 'r', 's') - * // Seq ['a', 'q', 'r', 's', 'd'] - * - */ - splice( - index: number, - removeNum: number, - ...values: /*Array | T>*/any[] - ): /*this*/IndexedIterable; - - /** - * Returns an Iterable of the same type "zipped" with the provided - * iterables. - * - * Like `zipWith`, but using the default `zipper`: creating an `Array`. - * - * var a = Seq.of(1, 2, 3); - * var b = Seq.of(4, 5, 6); - * var c = a.zip(b); // Seq [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] - * - */ - zip(...iterables: Array>): /*this*/IndexedIterable; - - /** - * Returns an Iterable of the same type "zipped" with the provided - * iterables by using a custom `zipper` function. - * - * var a = Seq.of(1, 2, 3); - * var b = Seq.of(4, 5, 6); - * var c = a.zip(b); // Seq [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] - * - */ - zipWith( - zipper: (value: T, otherValue: U) => Z, - otherIterable: Iterable - ): IndexedIterable; - zipWith( - zipper: (value: T, otherValue: U, thirdValue: V) => Z, - otherIterable: Iterable, - thirdIterable: Iterable - ): IndexedIterable; - zipWith( - zipper: (...any: Array) => Z, - ...iterables: Array> - ): IndexedIterable; - - - // Search for value - - /** - * Returns the first index at which a given value can be found in the - * Iterable, or -1 if it is not present. - */ - indexOf(searchValue: T): number; - - /** - * Returns the last index at which a given value can be found in the - * Iterable, or -1 if it is not present. - */ - lastIndexOf(searchValue: T): number; - - /** - * Returns the first index in the Iterable where a value satisfies the - * provided predicate function. Otherwise -1 is returned. - */ - findIndex( - predicate: (value?: T, index?: number, iter?: /*this*/IndexedIterable) => boolean, - context?: any - ): number; - - /** - * Returns the last index in the Iterable where a value satisfies the - * provided predicate function. Otherwise -1 is returned. - */ - findLastIndex( - predicate: (value?: T, index?: number, iter?: /*this*/IndexedIterable) => boolean, - context?: any - ): number; - } - - - /** - * Set Iterables only represent values. They have no associated keys or - * indices. Duplicate values are possible in SetSeqs, however the - * concrete `Set` does not allow duplicate values. - * - * Iterable methods on SetIterable such as `map` and `forEach` will provide - * the value as both the first and second arguments to the provided function. - * - * var seq = SetSeq.of('A', 'B', 'C'); - * assert.equal(seq.every((v, k) => v === k), true); - * - */ - export module SetIterable {} - - /** - * Similar to `Iterable()`, but always returns a SetIterable. - */ - export function SetIterable(iter: SetIterable): SetIterable; - export function SetIterable(iter: IndexedIterable): SetIterable; - export function SetIterable(iter: KeyedIterable): SetIterable; - export function SetIterable(array: Array): SetIterable; - export function SetIterable(iterator: Iterator): SetIterable; - export function SetIterable(iterable: /*Iterable*/Object): SetIterable; - - export interface SetIterable extends Iterable { - - /** - * Returns SetSeq. - * @override - */ - toSeq(): SetSeq; - } - - - /** - * Collection is the abstract base class for concrete data structures. It - * cannot be constructed directly. - * - * Implementations should extend one of the subclasses, `KeyedCollection`, - * `IndexedCollection`, or `SetCollection`. - */ - export module Collection {} - - export interface Collection extends Iterable { - - /** - * All collections maintain their current `size` as an integer. - */ - size: number; - } - - - /** - * `Collection` which represents key-value pairs. - */ - export module KeyedCollection {} - - export interface KeyedCollection extends Collection, KeyedIterable { - - /** - * Returns KeyedSeq. - * @override - */ - toSeq(): KeyedSeq; - } - - - /** - * `Collection` which represents ordered indexed values. - */ - export module IndexedCollection {} - - export interface IndexedCollection extends Collection, IndexedIterable { - - /** - * Returns IndexedSeq. - * @override - */ - toSeq(): IndexedSeq; - } - - - /** - * `Collection` which represents values, unassociated with keys or indices. - * - * `SetCollection` implementations should guarantee value uniqueness. - */ - export module SetCollection {} - - export interface SetCollection extends Collection, SetIterable { - - /** - * Returns SetSeq. - * @override - */ - toSeq(): SetSeq; - } - - - /** - * ES6 Iterator. - * - * This is not part of the Immutable library, but a common interface used by - * many types in ES6 JavaScript. - * - * @ignore - */ - export interface Iterator { - next(): { value: T; done: boolean; } - } - -} diff --git a/type-definitions/flow-tests/.flowconfig b/type-definitions/flow-tests/.flowconfig new file mode 100644 index 0000000000..8bacb74638 --- /dev/null +++ b/type-definitions/flow-tests/.flowconfig @@ -0,0 +1,9 @@ +[include] +../../ + +[options] +module.name_mapper='^immutable$' -> '../../type-definitions/immutable.js.flow' + +[ignore] +💩 Only interested in testing these files directly in this repo. +.*/node_modules/.* diff --git a/type-definitions/flow-tests/covariance.js b/type-definitions/flow-tests/covariance.js new file mode 100644 index 0000000000..6f325f4bae --- /dev/null +++ b/type-definitions/flow-tests/covariance.js @@ -0,0 +1,55 @@ +//@flow + +import { List, Map, Set, Stack, OrderedMap, OrderedSet } from 'immutable'; + +class A { + x: number; +} +class B extends A { + y: string; +} +class C { + z: string; +} + +// List covariance +declare var listOfB: List; +var listOfA: List = listOfB; +listOfA = List([new B()]); +// $FlowExpectedError[incompatible-type-arg] +var listOfC: List = listOfB; + +// Map covariance +declare var mapOfB: Map; +var mapOfA: Map = mapOfB; +mapOfA = Map({ b: new B() }); +// $FlowExpectedError[incompatible-type-arg] +var mapOfC: Map = mapOfB; + +// Set covariance +declare var setOfB: Set; +var setOfA: Set = setOfB; +setOfA = Set([new B()]); +// $FlowExpectedError[incompatible-type-arg] +var setOfC: Set = setOfB; + +// Stack covariance +declare var stackOfB: Stack; +var stackOfA: Stack = stackOfB; +stackOfA = Stack([new B()]); +// $FlowExpectedError[incompatible-type-arg] +var stackOfC: Stack = stackOfB; + +// OrderedMap covariance +declare var orderedMapOfB: OrderedMap; +var orderedMapOfA: OrderedMap = orderedMapOfB; +orderedMapOfA = OrderedMap({ b: new B() }); +// $FlowExpectedError[incompatible-type-arg] +var orderedMapOfC: OrderedMap = orderedMapOfB; + +// OrderedSet covariance +declare var orderedSetOfB: OrderedSet; +var orderedSetOfA: OrderedSet = orderedSetOfB; +orderedSetOfA = OrderedSet([new B()]); +// $FlowExpectedError[incompatible-type-arg] +var orderedSetOfC: OrderedSet = orderedSetOfB; diff --git a/type-definitions/flow-tests/es6-collections.js b/type-definitions/flow-tests/es6-collections.js new file mode 100644 index 0000000000..a763d6bf75 --- /dev/null +++ b/type-definitions/flow-tests/es6-collections.js @@ -0,0 +1,15 @@ +// @flow + +import { Map as ImmutableMap, Set as ImmutableSet } from 'immutable'; + +// Immutable.js collections +var mapImmutable: ImmutableMap = ImmutableMap(); +var setImmutable: ImmutableSet = ImmutableSet(); +var deleteResultImmutable: ImmutableMap = mapImmutable.delete( + 'foo' +); + +// ES6 collections +var mapES6: Map = new Map(); +var setES6: Set = new Set(); +var deleteResultES6: boolean = mapES6.delete('foo'); diff --git a/type-definitions/flow-tests/immutable-flow.js b/type-definitions/flow-tests/immutable-flow.js new file mode 100644 index 0000000000..c203962052 --- /dev/null +++ b/type-definitions/flow-tests/immutable-flow.js @@ -0,0 +1,1341 @@ +// @flow +// Some tests look like they are repeated in order to avoid false positives. +// Flow might not complain about an instance of (what it thinks is) T to be assigned to T + +import Immutable, { + List, + Map, + Stack, + Set, + Seq, + Range, + Repeat, + Record, + OrderedMap, + OrderedSet, + get, + getIn, + has, + hasIn, + merge, + mergeDeep, + mergeWith, + mergeDeepWith, + remove, + removeIn, + set, + setIn, + update, + updateIn, +} from 'immutable'; +import * as Immutable2 from 'immutable'; + +import type { + KeyedCollection, + IndexedCollection, + SetCollection, + KeyedSeq, + IndexedSeq, + SetSeq, + RecordFactory, + RecordOf, +} from 'immutable'; + +/** + * Although this looks like dead code, importing `Immutable` and + * `Immutable2` tests: + * + * 1. that default import works -- `import Immutable, {...} from 'immutable' + * 2. that importing everything works -- `import * as X from 'immutable'` + * 3. that individual imports are supported + */ +const ImmutableList = Immutable.List; +const ImmutableMap = Immutable.Map; +const ImmutableStack = Immutable.Stack; +const ImmutableSet = Immutable.Set; +const ImmutableKeyedCollection: KeyedCollection< + *, + * +> = Immutable.Collection.Keyed(); +const ImmutableRange = Immutable.Range; +const ImmutableRepeat = Immutable.Repeat; +const ImmutableIndexedSeq: IndexedSeq<*> = Immutable.Seq.Indexed(); + +const Immutable2List = Immutable2.List; +const Immutable2Map = Immutable2.Map; +const Immutable2Stack = Immutable2.Stack; +const Immutable2Set = Immutable2.Set; +const Immutable2KeyedCollection: Immutable2.KeyedCollection< + *, + * +> = Immutable2.Collection.Keyed(); +const Immutable2Range = Immutable2.Range; +const Immutable2Repeat = Immutable2.Repeat; +const Immutable2IndexedSeq: Immutable2.IndexedSeq<*> = Immutable2.Seq.Indexed(); + +var defaultExport: List<*> = Immutable.List(); +var moduleExport: List<*> = Immutable2.List(); + +var numberList: List = List(); +var numberOrStringList: List = List(); +var nullableNumberList: List = List(); +var stringToNumber: Map = Map(); +var orderedStringToNumber: OrderedMap = OrderedMap(); +var orderedStringToString: OrderedMap = OrderedMap(); +var orderedStringToNumberOrString: OrderedMap< + string, + string | number +> = OrderedMap(); +var orderedNumberToString: OrderedMap = OrderedMap(); +var orderedNumberToNumber: OrderedMap = OrderedMap(); +var stringToNumberOrString: Map = Map(); +var numberToString: Map = Map(); +var stringOrNumberToNumberOrString: Map< + string | number, + string | number +> = Map(); +var anyMap: Map = Map(); +var numberSet: Set = Set(); +var orderedStringSet: OrderedSet = OrderedSet(); +var orderedNumberSet: OrderedSet = OrderedSet(); +var orderedNumberOrStringSet: OrderedSet = OrderedSet(); +var numberOrStringSet: Set = Set(); +var stringSet: Set = Set(); +var numberStack: Stack = Stack(); +var numberOrStringStack: Stack = Stack(); +var number: number = 0; +var stringToNumberCollection: KeyedCollection = stringToNumber; +var numberToStringCollection: KeyedCollection = numberToString; +var partitions: [List, List]; + +numberList = List([1, 2]); +var numberListSize: number = numberList.size; +numberOrStringList = List(['a', 1]); +// $FlowExpectedError[incompatible-call] +numberList = List(['a', 'b']); + +numberList = List.of(1, 2); +numberOrStringList = List.of('a', 1); +// $FlowExpectedError[incompatible-call] +numberList = List.of('a', 1); + +numberList = List().set(0, 0); +numberOrStringList = List.of(0).set(1, 'a'); +// $FlowExpectedError[incompatible-call] +numberList = List().set(0, 'a'); + +numberList = List.of(1, 2, 3); +// $FlowExpectedError[incompatible-type] +var item: number = numberList.get(4); +var nullableItem: ?number = numberList.get(4); +var itemOrDefault: number = numberList.get(4, 10); + +// $FlowExpectedError[incompatible-type] +var item: number = numberList.first(); +// $FlowExpectedError[incompatible-type] +var func: () => number = () => numberList.first(); + +// $FlowExpectedError[incompatible-type] +var item: number = numberList.last(); +// $FlowExpectedError[incompatible-type] +var func: () => number = () => numberList.last(); + +numberList = List().insert(0, 0); +numberOrStringList = List.of(0).insert(1, 'a'); +// $FlowExpectedError[incompatible-call] +numberList = List().insert(0, 'a'); + +numberList = List().push(1, 1); +numberOrStringList = List().push(1, 'a'); +// $FlowExpectedError[incompatible-call] +numberList = List().push(0, 'a'); + +numberList = List().unshift(1, 1); +numberOrStringList = List().unshift(1, 'a'); +// $FlowExpectedError[incompatible-call] +numberList = List().unshift(0, 'a'); + +numberList = List.of(1).delete(0); +// $FlowExpectedError[incompatible-call] +numberList = List.of('a').delete(0); + +numberList = List.of(1).remove(0); +// $FlowExpectedError[incompatible-call] +numberList = List.of('a').remove(0); + +numberList = List.of(1).clear(); +// $FlowExpectedError[incompatible-call] +numberList = List.of('a').clear(); + +numberList = List.of(1).pop(); +// $FlowExpectedError[incompatible-call] +numberList = List.of('a').pop(); + +numberList = List.of(1).shift(); +// $FlowExpectedError[incompatible-call] +numberList = List.of('a').shift(); + +numberList = List.of('a').update((value) => List.of(1)); +// $FlowExpectedError[incompatible-call] +numberList = List.of(1).update((value) => List.of('a')); + +numberOrStringList = List.of('a').update(0, (value) => 1); +// $FlowExpectedError[incompatible-call] +numberList = List.of(1).update(0, (value) => 'a'); + +numberOrStringList = List.of(1).update(1, 0, (value) => 'a'); +// $FlowExpectedError[incompatible-call] +numberList = List.of(1).update(1, 0, (value) => 'a'); + +numberList = List.of(1).merge(List.of(2)); +numberOrStringList = List.of('a').merge(List.of(1)); +// $FlowExpectedError[incompatible-call] +numberList = List.of('a').merge(List.of(1)); + +// Functional API + +numberList = merge(List([1]), List([2])); +numberOrStringList = merge>(List(['a']), List([1])); +// $FlowExpectedError[incompatible-call] +numberList = merge(List(['a']), List([1])); + +nullableNumberList = List.of(1).setSize(2); + +// $FlowExpectedError[incompatible-type] setIn [] replaces the top-most value. number ~> List +numberList = List([1]).setIn([], 0); +{ + const x: number = List([1]).setIn([], 0); +} +// $FlowExpectedError[incompatible-call] "a" is not a valid key for List. +numberList = List([1]).setIn(['a'], 0); +// $FlowExpectedError[incompatible-type-arg] "a" is not a valid value for List of number. +numberList = List([1]).setIn([0], 'a'); +numberList = List([1]).setIn([0], 0); + +// $FlowExpectedError[incompatible-call] "a" is not a valid key for List. +List([List([List([1])])]).setIn([0, 0, 'a'], 'a'); +// $FlowExpectedError[incompatible-call] "a" is not a valid value for List of number. +List([List([List([1])])]).setIn([0, 0, 0], 'a'); +List([List([List([1])])]).setIn([0, 0, 0], 123); + +// $FlowExpectedError[incompatible-type] deleteIn [] replaces the top-most value. void ~> List +numberList = List([1]).deleteIn([]); +{ + const x: void = List([1]).deleteIn([]); +} +// $FlowExpectedError[incompatible-type] +numberList = List([1]).removeIn([]); +// $FlowExpectedError[incompatible-call] "a" is not a valid key for List. +numberList = List([1]).deleteIn(['a']); +// $FlowExpectedError[incompatible-call] +numberList = List([1]).removeIn(['a']); +numberList = List([1]).deleteIn([0]); +numberList = List([1]).removeIn([0]); + +// Functional API + +// $FlowExpectedError[incompatible-type] deleteIn [] replaces the top-most value. void ~> List +numberList = removeIn(List([1]), []); +{ + const x: void = removeIn(List([1]), []); +} +// $FlowExpectedError[incompatible-call] "a" is not a valid key for List. +numberList = removeIn(List([1]), ['a']); +numberList = removeIn(List([1]), [0]); + +// $FlowExpectedError[incompatible-type] updateIn [] replaces the top-most value. number ~> List +numberList = List([1]).updateIn([], () => 123); +{ + const x: number = List([1]).updateIn([], () => 123); +} +// $FlowExpectedError[incompatible-call] - 'a' is not a number +numberList = List([1]).updateIn([0], (val) => 'a'); +// $FlowExpectedError[incompatible-call] +numberList = List([1]).updateIn([0], 0, (val) => 'a'); +// $FlowExpectedError[incompatible-call] - 'a' in an invalid argument +numberList = List([1]).updateIn([0], 'a'); +// $FlowExpectedError[incompatible-call] +numberList = List([1]).updateIn([0], 0, 'a'); +numberList = List([1]).updateIn([0], (val) => val + 1); +numberList = List([1]).updateIn([0], 0, (val) => val + 1); + +numberList = List.of(1).mergeIn([], []); +numberList = List.of(1).mergeDeepIn([], []); + +numberList = List.of(1).withMutations((mutable) => mutable); + +numberList = List.of(1).asMutable(); +numberList = List.of(1).asImmutable(); + +numberList = List.of(1).map((value, index, iter) => 1); +// $FlowExpectedError[incompatible-call] +numberList = List.of(1).map((value, index, iter) => 'a'); + +numberList = List.of(1).flatMap((value, index, iter) => [1]); +// $FlowExpectedError[incompatible-call] +numberList = List.of(1).flatMap((value, index, iter) => ['a']); + +numberList = List.of(1).flatten(); + +// Specific type for filter(Boolean) which removes nullability. +numberList = nullableNumberList.filter(Boolean); + +partitions = List([1,2,3]).partition(value => value % 2); + +/* Map */ + +stringToNumber = Map(); +let stringToNumberSize: number = stringToNumber.size; +stringToNumberOrString = Map(); +numberToString = Map(); + +stringToNumber = Map({ a: 1 }); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 'a' }); + +stringToNumber = Map([['a', 1]]); +stringToNumber = Map(List([['a', 1]])); +// $FlowExpectedError[incompatible-call] +stringToNumber = Map([['a', 'b']]); +// $FlowExpectedError[incompatible-call] -- this is actually a Map +stringToNumber = Map(List([['a', 'a']])); +// $FlowFixMe[incompatible-call] - This is Iterable>, ideally it could be interpreted as Iterable<[string, string]> +stringToNumber = Map(List([List(['a', 'a'])])); + +stringOrNumberToNumberOrString = Map({ a: 'a' }).set('b', 1).set(2, 'c'); +// $FlowExpectedError[incompatible-call] +stringToNumber = Map({ a: 0 }).set('b', ''); +// $FlowExpectedError[incompatible-call] +stringToNumber = Map().set(1, ''); + +// Functional API + +stringToNumber = set(set(Map({ a: 0 }), 'b', 1), 'c', 2); +// $FlowExpectedError[incompatible-call] - Functional API currently requires arguments to have the same value types. +stringOrNumberToNumberOrString = set(set(Map({ a: 'a' }), 'b', 1), 2, 'c'); +// $FlowExpectedError[incompatible-call] +stringToNumber = set(Map({ a: 0 }), 'b', ''); +// $FlowExpectedError[incompatible-call] +stringToNumber = set(Map(), 1, ''); + +stringToNumber = Map({ a: 0 }).delete('a'); +stringToNumber = Map({ a: 0 }).remove('a'); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 0 }).delete(1); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 0 }).remove(1); + +stringToNumber = Map({ a: 0 }).deleteAll(['a']); +stringToNumber = Map({ a: 0 }).removeAll(['a']); +// $FlowExpectedError[prop-missing] +stringToNumber = Map({ a: 0 }).deleteAll(1); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 0 }).deleteAll([1]); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 0 }).removeAll([1]); + +stringToNumber = Map({ a: 0 }).clear(); + +stringToNumber = Map({ a: 1 }).update((value) => Map({ a: 1 })); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 1 }).update((value) => Map({ '1': 'a' })); + +stringToNumberOrString = Map({ a: 1 }).update('a', (value) => 'a'); +// $FlowExpectedError[incompatible-call] +stringToNumber = Map({ a: 1 }).update('a', (value) => 'a'); + +stringToNumberOrString = Map({ a: 1 }).update('a', 'b', (value) => 'a'); +// $FlowExpectedError[incompatible-type-arg] +// $FlowExpectedError[incompatible-call] +stringToNumber = Map({ a: 1 }).update('a', 'b', (value) => 'a'); +// $FlowExpectedError[incompatible-type-arg] +stringToNumberOrString = Map({ a: 1 }).merge({ a: { a: '1' } }); +// $FlowExpectedError[incompatible-type-arg] +stringToNumberOrString = Map({ a: 1 }).update('a', 'b', (value) => { + a: '1'; +}); + +stringToNumber = Map({ a: 1 }).merge(Map({ a: 1 })); +stringToNumberOrString = Map({ a: 1 }).merge({ a: 'b' }); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 1 }).merge({ a: 'b' }); +// $FlowExpectedError[incompatible-call] +stringToNumber = Map({ a: 1 }).merge([[1, 'a']]); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 1 }).merge(numberToString); + +// Functional API +stringToNumber = merge(Map({ a: 1 }), Map({ a: 1 })); +// $FlowExpectedError[incompatible-call] - Functional API currently requires arguments to have the same value types. +stringToNumberOrString = merge(Map({ a: 1 }), { a: 'b' }); +// $FlowExpectedError[incompatible-call] +stringToNumber = merge(Map({ a: 1 }), { a: 'b' }); +// $FlowExpectedError[incompatible-call] +stringToNumber = merge(Map({ a: 1 }), [[1, 'a']]); +// $FlowExpectedError[incompatible-call] +stringToNumber = merge(Map({ a: 1 }), numberToString); + +stringToNumber = Map({ a: 1 }).mergeWith((previous, next, key) => 1, { + a: 2, + b: 2, +}); +stringToNumber = Map({ a: 1 }).mergeWith( + // $FlowExpectedError[incompatible-call] + (previous, next, key) => previous + next, + // $FlowExpectedError[incompatible-type-arg] + { a: '2', b: '2' } +); +stringToNumberOrString = Map({ a: 1 }).mergeWith( + (previous, next, key) => previous + next, + { a: '2', b: '2' } +); +// $FlowExpectedError[incompatible-call] - the array [1] is not a valid argument +stringToNumber = Map({ a: 1 }).mergeWith((previous, next, key) => 1, [1]); + +stringToNumberOrString = Map({ a: 1 }).mergeDeep({ a: 'b' }); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 1 }).mergeDeep({ a: 'b' }); + +stringToNumber = Map({ a: 1 }).mergeDeepWith((previous, next, key) => 1, { + a: 2, + b: 2, +}); +stringToNumber = Map({ a: 1 }).mergeDeepWith( + (previous, next, key) => 1, + // $FlowExpectedError[incompatible-type-arg] + { a: '2', b: '2' } +); +stringToNumberOrString = Map({ a: 1 }).mergeDeepWith( + (previous, next, key) => 1, + { a: '2', b: '2' } +); +// $FlowExpectedError[incompatible-call] - the array [1] is not a valid argument +stringToNumber = Map({ a: 1 }).mergeDeepWith((previous, next, key) => 1, [1]); + +// KeyedSeq can merge into Map +var stringToStringSeq: KeyedSeq = Seq({ b: 'B' }); +stringToNumberOrString = Map({ a: 1 }).merge(stringToStringSeq); + +// $FlowExpectedError[incompatible-type] +stringToNumber = Map({ a: 1 }).setIn([], 0); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 1 }).setIn(['a'], 'a'); +stringToNumber = Map({ a: 1 }).setIn(['a'], 0); + +// $FlowExpectedError[incompatible-type] +stringToNumber = Map({ a: 1 }).deleteIn([]); +// $FlowExpectedError[incompatible-type] +stringToNumber = Map({ a: 1 }).removeIn([]); +stringToNumber = Map({ a: 1 }).deleteIn(['a']); +stringToNumber = Map({ a: 1 }).removeIn(['a']); + +// $FlowExpectedError[incompatible-type] +Map({ a: 1 }).updateIn([], (v) => v + 1); +// $FlowExpectedError[incompatible-call] +stringToNumber = Map({ a: 1 }).updateIn(['a'], (v) => 'a'); +stringToNumber = Map({ a: 1 }).updateIn(['a'], (v) => v + 1); +stringToNumber = Map({ a: 1 }).updateIn(['a'], 0, (v) => v + 1); + +Map({ x: Map({ y: Map({ z: 1 }) }) }).updateIn(['x', 'y', 'z'], (v) => v + 1); +Map({ x: Map({ y: Map({ z: 1 }) }) }).updateIn( + ['x', 'y', 'z'], + 0, + (v) => v + 1 +); + +// $FlowExpectedError[incompatible-call] +Map({ x: Map({ y: Map({ z: 1 }) }) }).updateIn(['x', 'y', 1], (v) => v + 1); +// $FlowExpectedError[incompatible-call] +Map({ x: Map({ y: Map({ z: 1 }) }) }).updateIn(['x', 'y', 'z'], (v) => 'a'); + +stringToNumber = Map({ a: 1 }).mergeIn([], []); +stringToNumber = Map({ a: 1 }).mergeDeepIn([], []); + +anyMap = Map({ a: {} }).mergeIn(['a'], Map({ b: 2 })); +anyMap = Map({ a: {} }).mergeDeepIn(['a'], Map({ b: 2 })); +anyMap = Map({ a: {} }).mergeIn(['a'], List([1, 2])); +anyMap = Map({ a: {} }).mergeDeepIn(['a'], List([1, 2])); +anyMap = Map({ a: {} }).mergeIn(['a'], { b: 2 }); +anyMap = Map({ a: {} }).mergeDeepIn(['a'], { b: 2 }); +// $FlowExpectedError[incompatible-call]: not iterable / object +anyMap = Map({ a: {} }).mergeIn(['a'], 1); +// $FlowExpectedError[incompatible-call]: not iterable / object +anyMap = Map({ a: {} }).mergeDeepIn(['a'], 1); +// $FlowExpectedError[incompatible-type-arg]: bad key type +stringToNumber = Map({ a: {} }).mergeIn([1], { b: 2 }); +// $FlowExpectedError[incompatible-type-arg]: bad key type +stringToNumber = Map({ a: {} }).mergeDeepIn([1], { b: 2 }); + +stringToNumber = Map({ a: 1 }).withMutations((mutable) => mutable); + +stringToNumber = Map({ a: 1 }).asMutable(); +stringToNumber = Map({ a: 1 }).asImmutable(); + +stringToNumber = Map({ a: 1 }).map((value, index, iter) => 1); +// $FlowExpectedError[incompatible-call] +stringToNumber = Map({ a: 1 }).map((value, index, iter) => 'a'); + +stringToNumber = Map({ a: 1 }).flatMap((value, index, iter) => [['b', 1]]); +// $FlowExpectedError[incompatible-call] +stringToNumber = Map({ a: 1 }).flatMap((value, index, iter) => [['a', 'a']]); +// $FlowExpectedError[incompatible-call] +stringToNumber = Map({ a: 1 }).flatMap((value, index, iter) => Map({ a: 'a' })); + +numberToString = Map({ a: 1 }).flip(); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 1 }).flip(); + +numberToString = Map({ a: 'a' }).mapKeys((key, value, iter) => 1); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = Map({ a: 1 }).mapKeys((key, value, iter) => 1); + +anyMap = Map({ a: 1 }).flatten(); + +var stringToNullableNumber = Map({ a: 1, b: null }); +// $FlowExpectedError[incompatible-type-arg] +stringToNumber = stringToNullableNumber; +// Specific type for filter(Boolean) which removes nullability. +stringToNumber = stringToNullableNumber.filter(Boolean); + +[anyMap, ] = Map({ "a": 1, "b": 2}).partition((key, index, iter) => key % 2) + +/* OrderedMap */ + +orderedStringToNumber = Map({ a: 1 }).toOrderedMap(); +// $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedMap +orderedStringToNumber = Map({ a: 'b' }).toOrderedMap(); +orderedStringToString = Map({ a: 'b' }).toOrderedMap(); + +orderedStringToNumber = OrderedMap({ a: 1 }); +// $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedMap +orderedStringToNumber = OrderedMap({ a: '1' }); +orderedStringToString = OrderedMap({ a: '1' }); + +orderedStringToNumber = OrderedMap(Map({ a: 1 })); +// $FlowExpectedError[incompatible-type-arg] - it's actually an OrderedMap +orderedStringToNumber = OrderedMap(Map({ a: '1' })); + +orderedStringToNumber = OrderedMap(); + +orderedStringToNumber = OrderedMap().set('b', 2); +// $FlowExpectedError[incompatible-call] - this is actually an OrderedMap +orderedStringToNumber = OrderedMap().set('b', '2'); +orderedStringToString = OrderedMap().set('b', '2'); + +orderedStringToNumber = OrderedMap({ a: 1 }).delete('a'); +orderedStringToNumber = OrderedMap({ a: 1 }).remove('a'); +orderedStringToNumber = OrderedMap({ a: 1 }).clear(); + +orderedStringToNumber = OrderedMap({ a: 1 }).update(() => OrderedMap({ b: 1 })); +/** + * TODO: the following is valid but I question if it should be valid: + * + * ``` + * const x: OrderedMap = OrderedMap({'a': 1}) + * .update(() => OrderedMap({'b': '1'})) + * ``` + * + * In the above example, `update` is changing an OrderedMap to an OrderedMap + * This seems inconsistent with the typescript signature of + * + * ``` + * update(updater: (value: Map) => Map): Map + * ``` + */ +orderedStringToNumber = OrderedMap({ a: 1 }).update(() => + // $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedMap + OrderedMap({ b: '1' }) +); +orderedStringToString = OrderedMap({ a: 1 }).update(() => + OrderedMap({ b: '1' }) +); + +orderedStringToNumber = OrderedMap({ a: 1 }).update('a', (value) => value + 1); +/** + * TODO: is the below the intended functionality? The typescript signature looks like + * + * ``` + * update(key: K, updater: (value: V) => V): Map; + * ``` + * + * so it seems like in this case the updater should only be able to return numbers. + * This comment applies to all of the update / merge functions in Map and OrderedMap + */ +// $FlowExpectedError[incompatible-call] - this is actually an OrderedMap +orderedStringToNumber = OrderedMap({ a: 1 }).update('a', () => 'b'); +orderedStringToNumberOrString = OrderedMap({ a: 1 }).update('a', () => 'b'); + +orderedStringToNumber = OrderedMap({ a: 1 }).update( + 'a', + 0, + (value) => value + 1 +); +// $FlowExpectedError[incompatible-call] - this is actually an OrderedMap +orderedStringToNumber = OrderedMap({ a: 1 }).update('a', 0, () => 'b'); +orderedStringToNumberOrString = OrderedMap({ a: 1 }).update('a', 0, () => 'b'); + +orderedStringToNumber = OrderedMap({ a: 1 }).merge({ b: 2 }); +// $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedMap +orderedStringToNumber = OrderedMap({ a: 1 }).merge({ b: '2' }); +orderedStringToNumberOrString = OrderedMap({ a: 1 }).merge({ b: '2' }); + +orderedStringToNumber = OrderedMap({ a: 1 }).mergeWith( + (prev, next) => next, + { a: 2, b: 3 } +); +orderedStringToNumber = OrderedMap({ a: 1 }).mergeWith( + // $FlowExpectedError[incompatible-call] + (prev, next) => next, + // $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedMap + { a: '2', b: '3' } +); +orderedStringToNumberOrString = OrderedMap({ a: 1 }).mergeWith( + (prev, next) => next, + { a: '2', b: '3' } +); +// $FlowExpectedError[incompatible-call] - the array [1] is not a valid argument +orderedStringToNumber = OrderedMap({ a: 1 }).mergeWith((prev, next) => next, [ + 1, +]); + +orderedStringToNumber = OrderedMap({ a: 1 }).mergeDeep({ a: 2 }); +// $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedMap +orderedStringToNumber = OrderedMap({ a: 1 }).mergeDeep({ a: '2' }); +orderedStringToNumberOrString = OrderedMap({ a: 1 }).mergeDeep({ a: '2' }); + +orderedStringToNumber = OrderedMap({ a: 1 }).mergeDeepWith( + (prev, next) => next, + { a: 2, b: 3 } +); +orderedStringToNumber = OrderedMap({ a: 1 }).mergeDeepWith( + (prev, next) => next, + // $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedMap + { a: '2', b: '3' } +); +orderedStringToNumberOrString = OrderedMap({ a: 1 }).mergeDeepWith( + (prev, next) => next, + { a: '2', b: '3' } +); +orderedStringToNumber = OrderedMap({ a: 1 }).mergeDeepWith( + (prev, next) => next, + // $FlowExpectedError[incompatible-call] - the array [1] is an invalid argument + [1] +); + +// $FlowExpectedError[incompatible-type] +orderedStringToNumber = OrderedMap({ a: 1 }).setIn([], 3); +// $FlowExpectedError[incompatible-type-arg] +orderedStringToNumber = OrderedMap({ a: 1 }).setIn([1], 3); +orderedStringToNumber = OrderedMap({ a: 1 }).setIn(['a'], 3); +// $FlowExpectedError[incompatible-type] +orderedStringToNumber = OrderedMap({ a: 1 }).deleteIn([]); +// $FlowExpectedError[incompatible-type] +orderedStringToNumber = OrderedMap({ a: 1 }).removeIn([]); +// $FlowExpectedError[incompatible-type-arg] +orderedStringToNumber = OrderedMap({ a: 1 }).deleteIn([1]); +// $FlowExpectedError[incompatible-type-arg] +orderedStringToNumber = OrderedMap({ a: 1 }).removeIn([1]); +orderedStringToNumber = OrderedMap({ a: 1 }).deleteIn(['b']); +orderedStringToNumber = OrderedMap({ a: 1 }).removeIn(['b']); + +// $FlowExpectedError[incompatible-type] +orderedStringToNumber = OrderedMap({ a: 1 }).updateIn([], (v) => v + 1); +// $FlowExpectedError[incompatible-type-arg] +orderedStringToNumber = OrderedMap({ a: 1 }).updateIn([1], (v) => v + 1); +// $FlowExpectedError[incompatible-call] +orderedStringToNumber = OrderedMap({ a: 1 }).updateIn(['a'], (v) => 'a'); +orderedStringToNumber = OrderedMap({ a: 1 }).updateIn(['a'], (v) => v + 1); +orderedStringToNumber = OrderedMap({ a: 1 }).updateIn(['a'], 0, (v) => v + 1); + +// $FlowExpectedError[incompatible-call] +OrderedMap({ x: OrderedMap({ y: 1 }) }).updateIn(['x', 1], (v) => v + 1); +// $FlowExpectedError[incompatible-call] +OrderedMap({ x: OrderedMap({ y: 1 }) }).updateIn(['x', 'y'], (v) => 'a'); +OrderedMap({ x: OrderedMap({ y: 1 }) }).updateIn(['x', 'y'], (v) => v + 1); +OrderedMap({ x: OrderedMap({ y: 1 }) }).updateIn(['x', 'y'], 0, (v) => v + 1); + +orderedStringToNumber = OrderedMap({ a: 1 }).mergeIn([], { b: 2 }); +orderedStringToNumber = OrderedMap({ a: 1 }).mergeDeepIn([], { b: 2 }); +orderedStringToNumber = OrderedMap({ a: 1 }).withMutations((mutable) => + mutable.set('b', 2) +); +orderedStringToNumber = OrderedMap({ a: 1 }).asMutable(); +orderedStringToNumber = OrderedMap({ a: 1 }).asImmutable(); + +orderedStringToNumber = OrderedMap({ a: 1 }).map((v) => v + 1); +// $FlowExpectedError[incompatible-call] - this is actually an OrderedMap +orderedStringToNumber = OrderedMap({ a: 1 }).map(() => 'a'); +orderedStringToString = OrderedMap({ a: 1 }).map(() => 'a'); + +orderedStringToNumber = OrderedMap({ a: 1 }).flatMap((v, k) => + OrderedMap({ [k]: v + 1 }) +); +orderedStringToNumber = OrderedMap({ a: 1 }).flatMap((v, k) => + // $FlowExpectedError[incompatible-call] - string "a" is not a number + OrderedMap({ [k]: 'a' }) +); + +// $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedMap +orderedStringToNumber = OrderedMap({ a: 1 }).flip(); +orderedNumberToString = OrderedMap({ a: 1 }).flip(); + +orderedStringToNumber = OrderedMap({ a: 1 }).mapKeys((x) => x); +// $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedMap +orderedStringToNumber = OrderedMap({ a: 1 }).mapKeys((x) => 1); +orderedNumberToNumber = OrderedMap({ a: 1 }).mapKeys((x) => 1); + +orderedStringToNumber = OrderedMap({ a: 1 }).flatten(); +orderedStringToNumber = OrderedMap({ a: 1 }).flatten(1); +orderedStringToNumber = OrderedMap({ a: 1 }).flatten(true); +// $FlowExpectedError[incompatible-call] - 'a' is an invalid argument +orderedStringToNumber = OrderedMap({ a: 1 }).flatten('a'); + +/* Set */ + +numberSet = Set(); +numberOrStringSet = Set(); +stringSet = Set(); + +numberSet = Set([1, 2, 3]); +// $FlowExpectedError[incompatible-call] +numberSet = Set(['a', 'b']); + +numberSet = Set.of(1, 2); +// $FlowExpectedError[incompatible-call] +numberSet = Set.of('a', 'b'); + +numberSet = Set.fromKeys(Map().set(1, '')); +stringSet = Set.fromKeys({ a: '' }); +// $FlowExpectedError[incompatible-type-arg] +numberSet = Set.fromKeys(Map({ a: 1 })); +// $FlowExpectedError[incompatible-type-arg] +numberSet = Set.fromKeys({ a: 1 }); + +numberOrStringSet = Set([1]).add('a'); +// $FlowExpectedError[incompatible-call] +numberSet = Set([1]).add('s'); + +numberSet = Set([1]).delete(1); +// $FlowExpectedError[incompatible-call] +numberSet = Set([1]).delete('a'); +// $FlowExpectedError[incompatible-call] +numberSet = Set(['a']).delete('a'); + +numberSet = Set([1]).remove(1); +// $FlowExpectedError[incompatible-call] +numberSet = Set([1]).remove('a'); +// $FlowExpectedError[incompatible-call] +numberSet = Set(['a']).remove('a'); + +numberSet = Set([1]).clear(); +// $FlowExpectedError[incompatible-call] +numberSet = Set(['a']).clear(); + +numberOrStringSet = Set(['a']).union([1]); +numberOrStringSet = Set(['a']).union(Set([1])); +numberSet = Set([1]).union([1]); +numberSet = Set([1]).union(Set([1])); +// $FlowExpectedError[incompatible-call] +numberSet = Set([1]).union(['a']); +// $FlowExpectedError[incompatible-call] +numberSet = Set([1]).union(Set(['a'])); + +numberOrStringSet = Set(['a']).merge([1]); +numberOrStringSet = Set(['a']).merge(Set([1])); +numberSet = Set([1]).merge([1]); +numberSet = Set([1]).merge(Set([1])); +// $FlowExpectedError[incompatible-call] +numberSet = Set([1]).merge(['a']); +// $FlowExpectedError[incompatible-call] +numberSet = Set([1]).merge(Set(['a'])); + +numberSet = Set([1]).intersect(Set([1])); +numberSet = Set([1]).intersect([1]); +numberSet = Set([1]).intersect(Set(['a'])); +numberSet = Set([1]).intersect(['a']); + +numberSet = Set([1]).subtract(Set([1])); +numberSet = Set([1]).subtract([1]); +numberSet = Set([1]).subtract(Set(['a'])); +numberSet = Set([1]).subtract(['a']); + +numberSet = Set([1]).withMutations((mutable) => mutable); +// $FlowExpectedError[incompatible-call] +stringSet = Set([1]).withMutations((mutable) => mutable); + +numberSet = Set([1]).asMutable(); +// $FlowExpectedError[incompatible-call] +stringSet = Set([1]).asMutable(); + +numberSet = Set([1]).asImmutable(); +// $FlowExpectedError[incompatible-call] +stringSet = Set([1]).asImmutable(); + +stringSet = Set([1]).map((value, index, iter) => 'a'); +// $FlowExpectedError[incompatible-call] +numberSet = Set([1]).map((value, index, iter) => 'a'); + +stringSet = Set([1]).flatMap((value, index, iter) => ['a']); +// $FlowExpectedError[incompatible-call] +numberSet = Set([1]).flatMap((value, index, iter) => ['a']); + +numberSet = Set([1]).flatten(); + +/* OrderedSet */ + +orderedStringSet = Set(['a']).toOrderedSet(); +// $FlowExpectedError[incompatible-call] - this is actually an OrderedSet +orderedStringSet = Set([1]).toOrderedSet(); +orderedNumberSet = Set([1]).toOrderedSet(); + +orderedStringSet = OrderedSet(['a']); +// $FlowExpectedError[incompatible-call] - this is actually an OrderedSet +orderedStringSet = OrderedSet([1]); +orderedNumberSet = OrderedSet([1]); + +orderedStringSet = OrderedSet(List.of('a')); +// $FlowExpectedError[incompatible-call] - this is actually an OrderedSet +orderedStringSet = OrderedSet(List.of(1)); +orderedNumberSet = OrderedSet(List.of(1)); + +orderedStringSet = OrderedSet.of('a', 'b', 'c'); +// $FlowExpectedError[incompatible-call] - this is actually an OrderedSet +orderedStringSet = OrderedSet.of(1); +orderedNumberSet = OrderedSet.of(1); + +orderedStringSet = OrderedSet.fromKeys(Map({ a: 1 })); +// $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedSet +orderedNumberSet = OrderedSet.fromKeys(Map({ a: 1 })); + +orderedStringSet = OrderedSet.fromKeys({ a: 1 }); +// $FlowExpectedError[incompatible-type-arg] - this is actually an OrderedSet +orderedNumberSet = OrderedSet.fromKeys({ a: 1 }); + +orderedStringSet = OrderedSet(); + +orderedStringSet = OrderedSet.of('a').add('b'); +/** + * TODO: in typescript definitions, add looks like + * + * ``` + * add(value: T): Set + * ``` + * + * so we shouldn't be able to add a number to a set of strings + */ +// $FlowExpectedError[incompatible-call] - this is actually an OrderedSet +orderedStringSet = OrderedSet('a').add(1); +orderedNumberOrStringSet = OrderedSet('a').add(1); + +orderedStringSet = OrderedSet.of('a').delete('a'); +// $FlowExpectedError[incompatible-call] - 1 is an invalid arg +orderedStringSet = OrderedSet.of('a').delete(1); + +orderedStringSet = OrderedSet.of('a').remove('a'); +// $FlowExpectedError[incompatible-call] - 1 is an invalid arg +orderedStringSet = OrderedSet.of('a').remove(1); + +orderedStringSet = OrderedSet.of('a').clear(); + +orderedStringSet = OrderedSet.of('a').union(OrderedSet.of('b')); +/** + * TODO: typescript def looks like + * + * ``` + * union(...iterables: Array[]): Set + * ``` + * + * so we shouldn't be able to merge strings and numbers + */ +// $FlowExpectedError[incompatible-call] - this is actually an OrderedSet +orderedStringSet = OrderedSet.of('a').union(OrderedSet.of(1)); +orderedNumberOrStringSet = OrderedSet.of('a').union(OrderedSet.of(1)); + +orderedStringSet = OrderedSet.of('a').merge(OrderedSet.of('b')); +/** + * TODO: typescript def looks like + * + * ``` + * merge(...iterables: Array[]): Set + * ``` + * + * so we shouldn't be able to merge strings and numbers + */ +// $FlowExpectedError[incompatible-call] - this is actually an OrderedSet +orderedStringSet = OrderedSet.of('a').merge(OrderedSet.of(1)); +orderedNumberOrStringSet = OrderedSet.of('a').merge(OrderedSet.of(1)); + +orderedStringSet = OrderedSet.of('a', 'b').intersect(OrderedSet.of('a')); +/** + * TODO: typescript def looks like + * + * ``` + * intersect(...iterables: Array[]): Set + * ``` + * + * so we shouldn't be able to intersect strings and numbers + */ +orderedStringSet = OrderedSet.of('a', 'b').intersect(OrderedSet.of(1)); + +orderedStringSet = OrderedSet.of('a', 'b').subtract(OrderedSet.of('a')); +/** + * TODO: typescript def looks like + * + * ``` + * subtract(...iterables: Array[]): Set + * ``` + * + * so we shouldn't be able to intersect strings and numbers + */ +orderedStringSet = OrderedSet.of('a', 'b').subtract(OrderedSet.of(1)); + +orderedStringSet = OrderedSet().withMutations((mutable) => mutable.add('a')); +orderedStringSet = OrderedSet.of('a').asMutable(); +orderedStringSet = OrderedSet.of('a').asImmutable(); + +orderedStringSet = OrderedSet.of('a', 'b').map((m) => m); +// $FlowExpectedError[incompatible-call] - this is an OrderedSet +orderedStringSet = OrderedSet.of('a', 'b').map(() => 1); +orderedNumberSet = OrderedSet.of('a', 'b').map(() => 1); + +orderedStringSet = OrderedSet.of('a', 'b').flatMap((m) => [m]); +// $FlowExpectedError[incompatible-call] - this is an OrderedSet +orderedStringSet = OrderedSet.of('a', 'b').flatMap((m) => [1]); +orderedNumberSet = OrderedSet.of('a', 'b').flatMap((m) => [1]); + +orderedStringSet = OrderedSet.of('a', 'b').flatten(1); +orderedStringSet = OrderedSet.of('a', 'b').flatten(false); +// $FlowExpectedError[incompatible-call] - invalid arg for flatten +orderedStringSet = OrderedSet.of('a', 'b').flatten('a'); + +/* Stack */ + +numberStack = Stack([1, 2]); +let numberStackSize: number = numberStack.size; +numberOrStringStack = Stack(['a', 1]); +// $FlowExpectedError[incompatible-call] +numberStack = Stack(['a', 'b']); + +numberStack = Stack.of(1, 2); +numberOrStringStack = Stack.of('a', 1); +// $FlowExpectedError[incompatible-call] +numberStack = Stack.of('a', 1); + +number = Stack([1]).peek(); +// $FlowExpectedError[incompatible-type] +number = Stack(['a']).peek(); + +numberStack = Stack([1]).unshift(1); +numberOrStringStack = Stack([1]).unshift('a'); +// $FlowExpectedError[incompatible-call] +numberStack = Stack([1]).unshift('a'); + +numberStack = Stack([1]).unshiftAll([1]); +numberOrStringStack = Stack([1]).unshiftAll(['a']); +// $FlowExpectedError[incompatible-call] +numberStack = Stack([1]).unshiftAll(['a']); + +numberStack = Stack.of(1).shift(); +// $FlowExpectedError[incompatible-call] +numberStack = Stack.of('a').shift(); + +numberStack = Stack().push(1); +numberOrStringStack = Stack([1]).push('a'); +// $FlowExpectedError[incompatible-call] +numberStack = Stack().push('a'); + +numberStack = Stack().pushAll([1]); +numberOrStringStack = Stack([1]).pushAll(['a']); +// $FlowExpectedError[incompatible-call] +numberStack = Stack().push(['a']); + +numberStack = Stack.of(1).pop(); +// $FlowExpectedError[incompatible-call] +numberStack = Stack.of('a').pop(); + +numberStack = Stack([1]).withMutations((mutable) => mutable); +// $FlowExpectedError[incompatible-call] +numberStack = Stack(['a']).withMutations((mutable) => mutable); + +numberStack = Stack([1]).asMutable(); +// $FlowExpectedError[incompatible-call] +numberStack = Stack(['a']).asMutable(); + +numberStack = Stack([1]).asImmutable(); +// $FlowExpectedError[incompatible-call] +numberStack = Stack(['a']).asImmutable(); + +numberStack = Stack([1]).map((value, index, iter) => 1); +// $FlowExpectedError[incompatible-call] +numberStack = Stack([1]).map((value, index, iter) => 'a'); + +numberStack = Stack([1]).flatMap((value, index, iter) => [1]); +// $FlowExpectedError[incompatible-call] +numberStack = Stack([1]).flatMap((value, index, iter) => ['a']); + +numberStack = Stack([1]).flatten(); +numberStack = Stack(['a']).flatten(); + +/* Range & Repeat */ + +// `{}` provide namespaces +{ + const numberSequence: IndexedSeq = Range(0, 0, 0); +} +{ + const numberSequence: IndexedSeq = Repeat(1, 5); +} + +{ + const stringSequence: IndexedSeq = Repeat('a', 5); +} +{ + // $FlowExpectedError[incompatible-call] + const stringSequence: IndexedSeq = Repeat(0, 1); +} +{ + // $FlowExpectedError[incompatible-type-arg] + const stringSequence: IndexedSeq = Range(0, 0, 0); +} + +/* Seq */ + +let numberSeq = Seq([1, 2, 3]); +// $FlowExpectedError[incompatible-type] +let numberSeqSize: number = numberSeq.size; +let maybeNumberSeqSize: ?number = numberSeq.size; + +/* Record */ + +type PersonRecordFields = { age: number, name: string }; +type PersonRecord = RecordOf; +const makePersonRecord: RecordFactory = Record({ + age: 900, + name: 'Yoda', +}); + +const personRecordInstance: PersonRecord = makePersonRecord({ age: 25 }); + +{ + // $FlowExpectedError[incompatible-type] + const age: string = personRecordInstance.get('age'); +} +{ + // $FlowExpectedError[incompatible-type] + const age: string = personRecordInstance.age; +} +{ + const age: number = personRecordInstance.get('age'); +} +{ + const age: number = personRecordInstance.age; +} + +// $FlowExpectedError[incompatible-call] +personRecordInstance.set('invalid', 25); +personRecordInstance.set('name', '25'); +personRecordInstance.set('age', 33); + +// FixMe: The first should be FlowExpectedError[incompatible-call], and the second two should be correct, +// however all three produce a hard to understand error because there is a bug +// with Flow's $Call utility type. +// set(personRecordInstance, 'invalid', 25) +// set(personRecordInstance, 'name', '25') +// set(personRecordInstance, 'age', 33) + +// Create a Map from a non-prototype "plain" Object +let someObj = Object.create(null); +someObj.x = 1; +someObj.y = 2; +let mapOfSomeObj: Map = Map(someObj); +// $FlowExpectedError[incompatible-call] - someObj is string -> number +let mapOfSomeObjMistake: Map = Map(someObj); + +// getIn() type + +// Deep nested +const deepData1: List> = List([Map([['apple', 'sauce']])]); +const deepNestedString1 = deepData1.getIn([0, 'apple']); +{ + // $FlowExpectedError[incompatible-type] string is not a number + const fail: ?number = deepNestedString1; +} +{ + // $FlowExpectedError[incompatible-type] getIn can return undefined + const fail: string = deepNestedString1; +} +{ + const success: ?string = deepNestedString1; +} + +const listOfListOfNumber: List> = List([List([1, 2, 3])]); +const nestedNum = listOfListOfNumber.getIn([0, 1]); +{ + // $FlowExpectedError[incompatible-type] number is not string + const fail: ?string = nestedNum; +} +{ + // $FlowExpectedError[incompatible-type] getIn can return undefined + const fail: number = nestedNum; +} +{ + const success: ?number = nestedNum; +} +// $FlowExpectedError[incompatible-call] expected a number 1st key +listOfListOfNumber.getIn(['whoops', 1]); +// $FlowExpectedError[incompatible-call] expected a number 2nd key +listOfListOfNumber.getIn([0, 'whoops']); +// $FlowExpectedError[incompatible-call] too many keys! +listOfListOfNumber.getIn([0, 0, 'whoops']); + +// Deep nested +const deepData: List>> = List([ + Map([['apple', List(['sauce'])]]), +]); +const deepNestedString = deepData.getIn([0, 'apple', 0]); +{ + // $FlowExpectedError[incompatible-type] string is not a number + const fail: ?number = deepNestedString; +} +{ + // $FlowExpectedError[incompatible-type] getIn can return undefined + const fail: string = deepNestedString; +} +{ + const success: ?string = deepNestedString; +} +// $FlowExpectedError[incompatible-call] expected a string 2nd key +deepData.getIn([0, 0, 0]); +// $FlowExpectedError[incompatible-call] expected a number 3rd key +deepData.getIn([0, 'apple', 'whoops']); + +// Containing Records +const listOfPersonRecord: List = List([personRecordInstance]); +const firstAge = listOfPersonRecord.getIn([0, 'age']); +{ + // $FlowExpectedError[incompatible-type] expected a string key + const age: string = firstAge; +} +{ + // $FlowExpectedError[incompatible-type] getIn can return undefined + const age: number = firstAge; +} +{ + const age: ?number = firstAge; +} +// $FlowExpectedError[incompatible-call] - the first key is not an index +listOfPersonRecord.getIn(['wrong', 'age']); +// $FlowExpectedError[incompatible-call] - the second key is not an record key +listOfPersonRecord.getIn([0, 'mispeld']); +// $FlowExpectedError[incompatible-call] - the second key is not an record key +listOfPersonRecord.getIn([0, 0]); +// $FlowExpectedError[incompatible-call] +listOfPersonRecord.setIn([0, 'age'], 'Thirteen'); +listOfPersonRecord.setIn([0, 'age'], 13); +// $FlowExpectedError[prop-missing] +listOfPersonRecord.updateIn([0, 'age'], (value) => value.unknownFunction()); +listOfPersonRecord.updateIn([0, 'age'], (value) => value + 1); +listOfPersonRecord.updateIn([0, 'age'], 0, (value) => value + 1); + +// Recursive Records +type PersonRecord2Fields = { name: string, friends: List }; +type PersonRecord2 = RecordOf; +const makePersonRecord2: RecordFactory = Record({ + name: 'Adam', + friends: List(), +}); +const friendly: PersonRecord2 = makePersonRecord2(); +{ + // $FlowExpectedError[incompatible-type] string is not a number + const fail: ?number = friendly.getIn(['friends', 0, 'name']); +} +// notSetValue provided +{ + const success: string = friendly.getIn(['friends', 0, 'name'], 'Abbie'); +} +{ + const success: ?string = friendly.getIn(['friends', 0, 'name']); +} + +// Functional API + +{ + // $FlowExpectedError[incompatible-type] string is not a number + const fail: ?number = getIn(friendly, ['friends', 0, 'name']); +} +// notSetValue provided +{ + const success: string = getIn(friendly, ['friends', 0, 'name'], 'Abbie'); +} +{ + const success: ?string = getIn(friendly, ['friends', 0, 'name']); +} + +// Deep nested containing recursive Records +const friendlies: List = List([makePersonRecord2()]); +{ + // $FlowExpectedError[incompatible-type] string is not a number + const fail: ?number = friendlies.getIn([0, 'friends', 0, 'name']); +} +// notSetValue provided +{ + const success: string = friendlies.getIn([0, 'friends', 0, 'name'], 'Abbie'); +} +{ + const success: ?string = friendlies.getIn([0, 'friends', 0, 'name']); +} +// $FlowExpectedError[incompatible-call] +friendlies.setIn([0, 'friends', 0, 'name'], 123); +friendlies.setIn([0, 'friends', 0, 'name'], 'Sally'); +friendlies.updateIn([0, 'friends', 0, 'name'], (value) => + // $FlowExpectedError[prop-missing] + value.unknownFunction() +); +friendlies.updateIn([0, 'friends', 0, 'name'], (value) => value.toUpperCase()); +friendlies.updateIn([0, 'friends', 0, 'name'], 'Unknown Name', (value) => + value.toUpperCase() +); + +// Nested plain JS values +type PlainPerson = { name: string, friends: Array }; +const plainFriendly: PlainPerson = { name: 'Bobbie', friends: [] }; +const plainFriendlies: List = List([plainFriendly]); + +{ + // $FlowExpectedError[incompatible-call] 'fraaands' is an unknown key in PlainPerson + const fail: ?number = plainFriendlies.getIn([0, 'fraaands', 0, 'name']); +} +{ + // $FlowExpectedError[incompatible-call] 0 is an unknown key in PlainPerson + const fail: ?number = plainFriendlies.getIn([0, 'fraaands', 0, 0]); +} +{ + // $FlowExpectedError[incompatible-type] string is not a number + const fail: ?number = plainFriendlies.getIn([0, 'friends', 0, 'name']); +} +{ + // $FlowExpectedError[incompatible-type] can return undefined + const fail: string = plainFriendlies.getIn([0, 'friends', 0, 'name']); +} +{ + const success: ?string = plainFriendlies.getIn([0, 'friends', 0, 'name']); +} + +// $FlowExpectedError[incompatible-call] number is not a string +plainFriendlies.setIn([0, 'friends', 0, 'name'], 123); +plainFriendlies.setIn([0, 'friends', 0, 'name'], 'Morgan'); + +plainFriendlies.updateIn([0, 'friends', 0, 'name'], (value) => + // $FlowExpectedError[prop-missing] value is a string, this is an unknown function + value.unknownFunction() +); +plainFriendlies.updateIn([0, 'friends', 0, 'name'], (value) => + value.toUpperCase() +); + +// $FlowExpectedError[incompatible-call] number is not a string +plainFriendlies.updateIn([0, 'friends', 0, 'name'], () => 123); +plainFriendlies.updateIn([0, 'friends', 0, 'name'], () => 'Whitney'); + +// Functional API + +{ + // $FlowExpectedError[incompatible-call] 'fraaands' is an unknown key in PlainPerson + const fail: ?number = getIn(plainFriendlies, [0, 'fraaands', 0, 'name']); +} +{ + // $FlowExpectedError[incompatible-call] 0 is an unknown key in PlainPerson + const fail: ?number = getIn(plainFriendlies, [0, 'fraaands', 0, 0]); +} +{ + // $FlowExpectedError[incompatible-type] string is not a number + const fail: ?number = getIn(plainFriendlies, [0, 'friends', 0, 'name']); +} +{ + // $FlowExpectedError[incompatible-type] can return undefined + const fail: string = getIn(plainFriendlies, [0, 'friends', 0, 'name']); +} +{ + const success: ?string = getIn(plainFriendlies, [0, 'friends', 0, 'name']); +} + +// $FlowExpectedError[incompatible-call] number is not a string +setIn(plainFriendlies, [0, 'friends', 0, 'name'], 123); +setIn(plainFriendlies, [0, 'friends', 0, 'name'], 'Morgan'); + +updateIn(plainFriendlies, [0, 'friends', 0, 'name'], (value) => + // $FlowExpectedError[prop-missing] value is a string, this is an unknown function + value.unknownFunction() +); +updateIn(plainFriendlies, [0, 'friends', 0, 'name'], (value) => + value.toUpperCase() +); + +// $FlowExpectedError[incompatible-call] number is not a string +updateIn(plainFriendlies, [0, 'friends', 0, 'name'], () => 123); +updateIn(plainFriendlies, [0, 'friends', 0, 'name'], () => 'Whitney'); + +// Plain JS values + +{ + const success: number | void = get([1, 2, 3], 0); +} +{ + const success: number | string = get([1, 2, 3], 0, 'missing'); +} +{ + // $FlowExpectedError[incompatible-call] - string is not an array index + const success: number = get([1, 2, 3], 'z'); +} +// Note: does not return null since x is known to exist in {x,y} +{ + const success: number = get({ x: 10, y: 10 }, 'x'); +} +{ + // $FlowExpectedError[incompatible-call] - z is not in {x,y} + const success: number | void = get({ x: 10, y: 10 }, 'z'); +} +{ + const objMap: { [string]: number } = { x: 10, y: 10 }; + const success: number | void = get(objMap, 'z'); +} +{ + const success: number = get({ x: 10, y: 10 }, 'x', 'missing'); +} +{ + const objMap: { [string]: number } = { x: 10, y: 10 }; + const success: number | string = get(objMap, 'z', 'missing'); +} + +// Deeply nested records + +type DeepNestFields = { + foo: number, +}; +type DeepNest = RecordOf; +const deepNest: RecordFactory = Record({ + foo: 0, +}); + +type NestFields = { + deepNest: DeepNest, +}; +type Nest = RecordOf; +const nest: RecordFactory = Record({ + deepNest: deepNest(), +}); + +type StateFields = { + nest: Nest, +}; +type State = RecordOf; +const initialState: RecordFactory = Record({ + nest: nest(), +}); + +const state = initialState(); +(state.setIn(['nest', 'deepNest', 'foo'], 5): State); +// $FlowExpectedError[incompatible-call] +(state.setIn(['nest', 'deepNest', 'foo'], 'string'): State); +// $FlowExpectedError[incompatible-call] +(state.setIn(['nest', 'deepNest', 'unknownField'], 5): State); diff --git a/type-definitions/flow-tests/merge.js b/type-definitions/flow-tests/merge.js new file mode 100644 index 0000000000..ad4cc4b21f --- /dev/null +++ b/type-definitions/flow-tests/merge.js @@ -0,0 +1,138 @@ +// @flow +import { + List, + Map, + Record, + type RecordOf, + type RecordFactory, + get, + getIn, + has, + hasIn, + merge, + mergeDeep, + mergeWith, + mergeDeepWith, + remove, + removeIn, + set, + setIn, + update, + updateIn, +} from 'immutable'; + +// merge: Objects as Maps + +type ObjMap = { [key: string]: T }; +const objMap: ObjMap = { x: 12, y: 34 }; +(merge(objMap, { x: 321 }): ObjMap); +(merge(objMap, { z: 321 }): ObjMap); +// $FlowExpectedError[incompatible-call] +(merge(objMap, { x: 'abc' }): ObjMap); +(merge(objMap, [['x', 321]]): ObjMap); +(merge(objMap, [['z', 321]]): ObjMap); +// $FlowExpectedError[incompatible-call] +(merge(objMap, [['x', 'abc']]): ObjMap); +// $FlowExpectedError[incompatible-call] +(merge(objMap, [321]): ObjMap); +(merge(objMap, Map({ x: 123 })): ObjMap); +(merge(objMap, Map({ z: 123 })): ObjMap); +(merge(objMap, Map([['x', 123]])): ObjMap); +(merge(objMap, Map([['z', 123]])): ObjMap); +// $FlowExpectedError[incompatible-call] +(merge(objMap, List([123])): ObjMap); + +// merge: Maps + +const map = Map({ key: 'value' }); +(merge(map, { key: 'alternate' }): Map); +(merge(map, { otherKey: 'value' }): Map); +(merge(map, Map({ key: 'alternate' })): Map); +(merge(map, Map({ otherKey: 'value' })): Map); +(merge(map, [['otherKey', 'value']]): Map); +// $FlowExpectedError[incompatible-call] (functional merge cannot return union value types) +(merge(map, Map({ otherKey: 123 })): Map); +// $FlowExpectedError[incompatible-call] +(merge(map, [4, 5, 6]): Map); +// $FlowExpectedError[incompatible-call] +(merge(map, 123): Map); +// $FlowExpectedError[incompatible-call] +(merge(map, { '0': 123 }): Map); +// $FlowExpectedError[incompatible-call] +(merge(map, [ + [0, 4], + [1, 5], + [1, 6], +]): Map); + +// merge: Lists + +const list = List([1, 2, 3]); +(merge(list, [4, 5, 6]): List); +(merge(list, List([4, 5, 6])): List); +// $FlowExpectedError[incompatible-call] (functional merge cannot return union value types) +(merge(list, ['a', 'b', 'c']): List); +// $FlowExpectedError[incompatible-call] (functional merge cannot return union value types) +(merge(list, List(['a', 'b', 'c'])): List); +// $FlowExpectedError[incompatible-call] +(merge(list, 123): List); +// $FlowExpectedError[incompatible-call] +(merge(list, { '0': 123 }): List); +// $FlowExpectedError[incompatible-call] +(merge(list, Map({ '0': 123 })): List); +// $FlowExpectedError[incompatible-call] +(merge(list, [ + [0, 4], + [1, 5], + [1, 6], +]): List); + +// merge: Objects as Records + +type XYPoint = { x: number, y: number }; +const objRecord: XYPoint = { x: 12, y: 34 }; +(merge(objRecord, { x: 321 }): XYPoint); +(merge(objRecord, [['x', 321]]): XYPoint); +(merge(objRecord, Map({ x: 123 })): XYPoint); +(merge(objRecord, Map([['x', 123]])): XYPoint); +const xyPointRecord = Record({ x: 0, y: 0 }); +(merge(objRecord, xyPointRecord({ x: 321 })): XYPoint); +// $FlowExpectedError[incompatible-call] +(merge(objRecord, { x: 'abc' }): XYPoint); +// $FlowExpectedError[incompatible-call] +(merge({ x: 12, y: 34 }, [['x', 'abc']]): XYPoint); +// $FlowExpectedError[incompatible-call] +(merge(objRecord, { z: 321 }): XYPoint); +// $FlowExpectedError[prop-missing]] +// $FlowExpectedError[invalid-call-util]] +(merge(objRecord, [['z', 321]]): XYPoint); +// $FlowExpectedError[incompatible-call] +(merge(objRecord, Map({ z: 123 })): XYPoint); +// $FlowExpectedError[incompatible-call] +(merge(objRecord, Map([['z', 123]])): XYPoint); +// $FlowExpectedError[incompatible-call] +(merge(objRecord, [321]): XYPoint); +// $FlowExpectedError[incompatible-call] +(merge(objRecord, List([123])): XYPoint); + +// merge: Arrays + +const arr = [1, 2, 3]; +(merge(arr, [4, 5, 6]): Array); +(merge(arr, List([4, 5, 6])): Array); +// $FlowExpectedError[incompatible-call] (functional merge cannot return union value types) +(merge(arr, ['a', 'b', 'c']): Array); +// $FlowExpectedError[incompatible-call] (functional merge cannot return union value types) +(merge(arr, List(['a', 'b', 'c'])): Array); +// $FlowExpectedError[incompatible-call] +(merge(arr, 123): Array); +// $FlowExpectedError[incompatible-call] +(merge(arr, { '0': 123 }): Array); +// $FlowExpectedError[incompatible-call] +(merge(arr, Map({ '0': 123 })): Array); +// $FlowExpectedError[incompatible-call] +(merge(arr, [ + [0, 4], + [1, 5], + [1, 6], +]): Array); diff --git a/type-definitions/flow-tests/predicates.js b/type-definitions/flow-tests/predicates.js new file mode 100644 index 0000000000..a72072bb96 --- /dev/null +++ b/type-definitions/flow-tests/predicates.js @@ -0,0 +1,17 @@ +// @flow +import { List } from 'immutable'; + +declare var mystery: mixed; + +// $FlowExpectedError[cannot-resolve-name] +maybe.push('3'); + +if (mystery instanceof List) { + maybe.push('3'); +} + +// Note: Flow's support for %checks is still experimental. +// Support this in the future. +// if (List.isList(mystery)) { +// mystery.push('3'); +// } diff --git a/type-definitions/flow-tests/record.js b/type-definitions/flow-tests/record.js new file mode 100644 index 0000000000..d820608d92 --- /dev/null +++ b/type-definitions/flow-tests/record.js @@ -0,0 +1,217 @@ +// @flow +// Some tests look like they are repeated in order to avoid false positives. +// Flow might not complain about an instance of (what it thinks is) T to be assigned to T + +import { Record, type RecordFactory, type RecordOf, Map, List, merge } from 'immutable'; + +// Use the RecordFactory type to annotate +const Point2: RecordFactory<{ x: number, y: number }> = Record({ x: 0, y: 0 }); +const Point3: RecordFactory<{ x: number, y: number, z: number }> = Record({ + x: 0, + y: 0, + z: 0, +}); +type TGeoPoint = { lat: ?number, lon: ?number }; +const GeoPoint: RecordFactory = Record({ lat: null, lon: null }); + +// TODO: this should be FlowExpectedError - 'abc' is not a number +// However, due to support for the brittle support for subclassing, Flow +// cannot also type check default values in this position. +const PointWhoops: RecordFactory<{ x: number, y: number }> = Record({ + x: 0, + y: 'abc', +}); + +let origin2 = Point2({}); +let origin3 = Point3({}); +let geo = GeoPoint({ lat: 34 }); +// $FlowExpectedError[incompatible-call] +const mistake = Point2({ x: 'string' }); +origin3 = GeoPoint({ lat: 34 }); +geo = Point3({}); + +// Use RecordOf to type the return value of a Record factory function. +let geoPointExpected1: RecordOf = GeoPoint({}); + +// $FlowExpectedError[prop-missing] - Point2 does not return GeoPoint. +let geoPointExpected2: RecordOf = Point2({}); + +const px = origin2.get('x'); +const px2: number = origin2.x; +// $FlowExpectedError[incompatible-type] +const px3: number = origin2.get('x', 'not set value'); +const px4: number | string = origin2.get('x', 'not set value'); +// $FlowExpectedError[incompatible-call] +const pz = origin2.get('z'); +// $FlowExpectedError[incompatible-use] +const pz2 = origin2.z; + +origin2.set('x', 4); +// $FlowExpectedError[incompatible-call] +origin2.set('x', 'not-a-number'); +// $FlowExpectedError[incompatible-call] +origin2.set('z', 3); + +const name: string = Record.getDescriptiveName(origin2); +// $FlowExpectedError[incompatible-call] +const name2: string = Record.getDescriptiveName({}); + +// Note: need to cast through any when extending Records as if they ere classes +class ABClass extends (Record({ a: 1, b: 2 }): any) { + setA(a: number) { + return this.set('a', a); + } + + setB(b: number) { + return this.set('b', b); + } +} + +var t1 = new ABClass({ a: 1 }); +var t2 = t1.setA(3); +var t3 = t2.setB(10); +// Note: flow does not check extended Record classes yet +var t4 = t2.setC(10); + +// Note: flow does not check extended Record classes yet +var t1a: string = t1.a; +// Note: flow does not check extended Record classes yet +var t1c = t1.c; + +// Use of new to create record factories (supported, but discouraged) +type TPointNew = { x: number, y: number }; +type PointNew = RecordOf; +const MakePointNew: RecordFactory = new Record({ x: 0, y: 0 }); +// Not using new allows returning a record. +const origin: PointNew = MakePointNew(); +// Both get and prop access are supported with RecordOf +{ + const x: number = origin.get('x'); +} +{ + const x: number = origin.x; +} +{ + // $FlowExpectedError[incompatible-type] number is not a string + const x: string = origin.x; +} +// Can use the Record constructor type as an alternative, +// it just doesn't support property access. +const originAlt1: MakePointNew = MakePointNew(); +// Both get and prop access are supported with RecordOf +{ + const x: number = originAlt1.get('x'); +} +{ + // $FlowExpectedError[prop-missing] cannot use property access for this alternative annotation + const x: number = originAlt1.x; +} +// Can also sort of use the inner Record values type as an alternative, +// however it does not have the immutable record API, though useful for flowing +// immutable Records where plain objects are expected. +// Remember that Records are *read only*, and using the $ReadOnly helper type +// can ensure correct types. +const originAlt2: $ReadOnly = MakePointNew(); +{ + // $FlowExpectedError[prop-missing] cannot use Record API for this alternative annotation + const x: number = originAlt2.get('x'); +} +{ + const x: number = originAlt2.x; +} + +// Use of new may only return a class instance, not a record +// (supported but discouraged) +// $FlowExpectedError[class-object-subtyping] +// $FlowExpectedError[prop-missing] +const mistakeOriginNew: PointNew = new MakePointNew(); +// An alternative type strategy is instance based +const originNew: MakePointNew = new MakePointNew(); +// Only get, but not prop access are supported with class instances +{ + const x: number = originNew.get('x'); +} +{ + // $FlowExpectedError[prop-missing] property `x`. Property not found in RecordInstance + const x: number = originNew.x; +} + +// $FlowExpectedError[incompatible-call] instantiated with invalid type +const mistakeNewRecord = MakePointNew({ x: 'string' }); +// $FlowExpectedError[incompatible-call] instantiated with invalid type +const mistakeNewInstance = new MakePointNew({ x: 'string' }); + +// Subclassing + +// Note use of + for Read Only. +type TPerson = { +name: string, +age: number }; +const defaultValues: TPerson = { name: 'Aristotle', age: 2400 }; +const PersonRecord = Record(defaultValues); + +class Person extends PersonRecord { + getName(): string { + return this.get('name'); + } + + setName(name: string): this & TPerson { + return this.set('name', name); + } +} + +const person = new Person(); +(person.setName('Thales'): Person); +(person.getName(): string); +(person.setName('Thales').getName(): string); +(person.setName('Thales').name: string); +person.get('name'); +person.set('name', 'Thales'); +// $FlowExpectedError[incompatible-call] +person.get('unknown'); +// $FlowExpectedError[prop-missing] +person.set('unknown', 'Thales'); + +// Note: not +class PersonWithoutTypes extends PersonRecord { + getName(): string { + return this.get('name'); + } + + setName(name: string): this & TPerson { + return this.set('name', name); + } +} + +const person2 = new PersonWithoutTypes(); + +person2.get('name'); +// Note: no error +person2.get('unknown'); + + +// Functional Merge + +type XYPoint = { x: number, y: number }; +type XYPointRecord = RecordOf; +const xyRecord: RecordFactory = Record({ x: 0, y: 0 }); +const record = xyRecord(); +(merge(record, { x: 321 }): XYPointRecord); +(merge(record, xyRecord({ x: 321 })): XYPointRecord); +// $FlowExpectedError[incompatible-call] +(merge(record, { z: 321 }): XYPointRecord); +// $FlowExpectedError[incompatible-call] +(merge(record, { x: 'abc' }): XYPointRecord); +(merge(record, [['x', 321]]): XYPointRecord); +// $FlowExpectedError[prop-missing]] +(merge(record, [['z', 321]]): XYPointRecord); +// $FlowExpectedError[incompatible-call] +(merge(record, [['x', 'abc']]): XYPointRecord); +// $FlowExpectedError[incompatible-call] +(merge(record, [321]): XYPointRecord); +(merge(record, Map({ x: 123 })): XYPointRecord); +// $FlowExpectedError[incompatible-call] +(merge(record, Map({ z: 123 })): XYPointRecord); +(merge(record, Map([['x', 123]])): XYPointRecord); +// $FlowExpectedError[incompatible-call] +(merge(record, Map([['z', 123]])): XYPointRecord); +// $FlowExpectedError[incompatible-call] +(merge(record, List([123])): XYPointRecord); diff --git a/type-definitions/immutable.d.ts b/type-definitions/immutable.d.ts new file mode 100644 index 0000000000..331dc2c6a8 --- /dev/null +++ b/type-definitions/immutable.d.ts @@ -0,0 +1,6249 @@ +/** @ignore we should disable this rules, but let's activate it to enable eslint first */ +/** + * Immutable data encourages pure functions (data-in, data-out) and lends itself + * to much simpler application development and enabling techniques from + * functional programming such as lazy evaluation. + * + * While designed to bring these powerful functional concepts to JavaScript, it + * presents an Object-Oriented API familiar to Javascript engineers and closely + * mirroring that of Array, Map, and Set. It is easy and efficient to convert to + * and from plain Javascript types. + * + * ## How to read these docs + * + * In order to better explain what kinds of values the Immutable.js API expects + * and produces, this documentation is presented in a statically typed dialect of + * JavaScript (like [Flow][] or [TypeScript][]). You *don't need* to use these + * type checking tools in order to use Immutable.js, however becoming familiar + * with their syntax will help you get a deeper understanding of this API. + * + * **A few examples and how to read them.** + * + * All methods describe the kinds of data they accept and the kinds of data + * they return. For example a function which accepts two numbers and returns + * a number would look like this: + * + * ```js + * sum(first: number, second: number): number + * ``` + * + * Sometimes, methods can accept different kinds of data or return different + * kinds of data, and this is described with a *type variable*, which is + * typically in all-caps. For example, a function which always returns the same + * kind of data it was provided would look like this: + * + * ```js + * identity(value: T): T + * ``` + * + * Type variables are defined with classes and referred to in methods. For + * example, a class that holds onto a value for you might look like this: + * + * ```js + * class Box { + * constructor(value: T) + * getValue(): T + * } + * ``` + * + * In order to manipulate Immutable data, methods that we're used to affecting + * a Collection instead return a new Collection of the same type. The type + * `this` refers to the same kind of class. For example, a List which returns + * new Lists when you `push` a value onto it might look like: + * + * ```js + * class List { + * push(value: T): this + * } + * ``` + * + * Many methods in Immutable.js accept values which implement the JavaScript + * [Iterable][] protocol, and might appear like `Iterable` for something + * which represents sequence of strings. Typically in JavaScript we use plain + * Arrays (`[]`) when an Iterable is expected, but also all of the Immutable.js + * collections are iterable themselves! + * + * For example, to get a value deep within a structure of data, we might use + * `getIn` which expects an `Iterable` path: + * + * ``` + * getIn(path: Iterable): unknown + * ``` + * + * To use this method, we could pass an array: `data.getIn([ "key", 2 ])`. + * + * + * Note: All examples are presented in the modern [ES2015][] version of + * JavaScript. Use tools like Babel to support older browsers. + * + * For example: + * + * ```js + * // ES2015 + * const mappedFoo = foo.map(x => x * x); + * // ES5 + * var mappedFoo = foo.map(function (x) { return x * x; }); + * ``` + * + * [ES2015]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/ECMAScript_6_support_in_Mozilla + * [TypeScript]: https://www.typescriptlang.org/ + * [Flow]: https://flowtype.org/ + * [Iterable]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols + */ + +declare namespace Immutable { + /** @ignore */ + type OnlyObject = Extract; + + /** @ignore */ + type ContainObject = + OnlyObject extends object + ? OnlyObject extends never + ? false + : true + : false; + + /** + * @ignore + * + * Used to convert deeply all immutable types to a plain TS type. + * Using `unknown` on object instead of recursive call as we have a circular reference issue + */ + export type DeepCopy = + T extends Record + ? // convert Record to DeepCopy plain JS object + { + [key in keyof R]: ContainObject extends true + ? unknown + : R[key]; + } + : T extends MapOf + ? // convert MapOf to DeepCopy plain JS object + { + [key in keyof R]: ContainObject extends true + ? unknown + : R[key]; + } + : T extends Collection.Keyed + ? // convert KeyedCollection to DeepCopy plain JS object + { + [key in KeyedKey extends PropertyKey + ? KeyedKey + : string]: V extends object ? unknown : V; + } + : // convert IndexedCollection or Immutable.Set to DeepCopy plain JS array + // eslint-disable-next-line @typescript-eslint/no-unused-vars + T extends Collection + ? Array> + : T extends string | number // Iterable scalar types : should be kept as is + ? T + : T extends Iterable // Iterable are converted to plain JS array + ? Array> + : T extends object // plain JS object are converted deeply + ? { + [ObjectKey in keyof T]: ContainObject< + T[ObjectKey] + > extends true + ? unknown + : T[ObjectKey]; + } + : // other case : should be kept as is + T; + + /** + * Describes which item in a pair should be placed first when sorting + * + * @ignore + */ + export enum PairSorting { + LeftThenRight = -1, + RightThenLeft = +1, + } + + /** + * Function comparing two items of the same type. It can return: + * + * * a PairSorting value, to indicate whether the left-hand item or the right-hand item should be placed before the other + * + * * the traditional numeric return value - especially -1, 0, or 1 + * + * @ignore + */ + export type Comparator = (left: T, right: T) => PairSorting | number; + + /** + * @ignore + * + * KeyPath allowed for `xxxIn` methods + */ + export type KeyPath = OrderedCollection | ArrayLike; + + /** + * Lists are ordered indexed dense collections, much like a JavaScript + * Array. + * + * Lists are immutable and fully persistent with O(log32 N) gets and sets, + * and O(1) push and pop. + * + * Lists implement Deque, with efficient addition and removal from both the + * end (`push`, `pop`) and beginning (`unshift`, `shift`). + * + * Unlike a JavaScript Array, there is no distinction between an + * "unset" index and an index set to `undefined`. `List#forEach` visits all + * indices from 0 to size, regardless of whether they were explicitly defined. + */ + namespace List { + /** + * True if the provided value is a List + * + * + * ```js + * const { List } = require('immutable'); + * List.isList([]); // false + * List.isList(List()); // true + * ``` + */ + function isList(maybeList: unknown): maybeList is List; + + /** + * Creates a new List containing `values`. + * + * + * ```js + * const { List } = require('immutable'); + * List.of(1, 2, 3, 4) + * // List [ 1, 2, 3, 4 ] + * ``` + * + * Note: Values are not altered or converted in any way. + * + * + * ```js + * const { List } = require('immutable'); + * List.of({x:1}, 2, [3], 4) + * // List [ { x: 1 }, 2, [ 3 ], 4 ] + * ``` + */ + function of(...values: Array): List; + } + + /** + * Create a new immutable List containing the values of the provided + * collection-like. + * + * Note: `List` is a factory function and not a class, and does not use the + * `new` keyword during construction. + * + * + * ```js + * const { List, Set } = require('immutable') + * + * const emptyList = List() + * // List [] + * + * const plainArray = [ 1, 2, 3, 4 ] + * const listFromPlainArray = List(plainArray) + * // List [ 1, 2, 3, 4 ] + * + * const plainSet = Set([ 1, 2, 3, 4 ]) + * const listFromPlainSet = List(plainSet) + * // List [ 1, 2, 3, 4 ] + * + * const arrayIterator = plainArray[Symbol.iterator]() + * const listFromCollectionArray = List(arrayIterator) + * // List [ 1, 2, 3, 4 ] + * + * listFromPlainArray.equals(listFromCollectionArray) // true + * listFromPlainSet.equals(listFromCollectionArray) // true + * listFromPlainSet.equals(listFromPlainArray) // true + * ``` + */ + function List(collection?: Iterable | ArrayLike): List; + + interface List extends Collection.Indexed { + /** + * The number of items in this List. + */ + readonly size: number; + + // Persistent changes + + /** + * Returns a new List which includes `value` at `index`. If `index` already + * exists in this List, it will be replaced. + * + * `index` may be a negative number, which indexes back from the end of the + * List. `v.set(-1, "value")` sets the last item in the List. + * + * If `index` larger than `size`, the returned List's `size` will be large + * enough to include the `index`. + * + * + * ```js + * const originalList = List([ 0 ]); + * // List [ 0 ] + * originalList.set(1, 1); + * // List [ 0, 1 ] + * originalList.set(0, 'overwritten'); + * // List [ "overwritten" ] + * originalList.set(2, 2); + * // List [ 0, undefined, 2 ] + * + * List().set(50000, 'value').size; + * // 50001 + * ``` + * + * Note: `set` can be used in `withMutations`. + */ + set(index: number, value: T): List; + + /** + * Returns a new List which excludes this `index` and with a size 1 less + * than this List. Values at indices above `index` are shifted down by 1 to + * fill the position. + * + * This is synonymous with `list.splice(index, 1)`. + * + * `index` may be a negative number, which indexes back from the end of the + * List. `v.delete(-1)` deletes the last item in the List. + * + * Note: `delete` cannot be safely used in IE8 + * + * + * ```js + * List([ 0, 1, 2, 3, 4 ]).delete(0); + * // List [ 1, 2, 3, 4 ] + * ``` + * + * Since `delete()` re-indexes values, it produces a complete copy, which + * has `O(N)` complexity. + * + * Note: `delete` *cannot* be used in `withMutations`. + * + * @alias remove + */ + delete(index: number): List; + remove(index: number): List; + + /** + * Returns a new List with `value` at `index` with a size 1 more than this + * List. Values at indices above `index` are shifted over by 1. + * + * This is synonymous with `list.splice(index, 0, value)`. + * + * + * ```js + * List([ 0, 1, 2, 3, 4 ]).insert(6, 5) + * // List [ 0, 1, 2, 3, 4, 5 ] + * ``` + * + * Since `insert()` re-indexes values, it produces a complete copy, which + * has `O(N)` complexity. + * + * Note: `insert` *cannot* be used in `withMutations`. + */ + insert(index: number, value: T): List; + + /** + * Returns a new List with 0 size and no values in constant time. + * + * + * ```js + * List([ 1, 2, 3, 4 ]).clear() + * // List [] + * ``` + * + * Note: `clear` can be used in `withMutations`. + */ + clear(): List; + + /** + * Returns a new List with the provided `values` appended, starting at this + * List's `size`. + * + * + * ```js + * List([ 1, 2, 3, 4 ]).push(5) + * // List [ 1, 2, 3, 4, 5 ] + * ``` + * + * Note: `push` can be used in `withMutations`. + */ + push(...values: Array): List; + + /** + * Returns a new List with a size ones less than this List, excluding + * the last index in this List. + * + * Note: this differs from `Array#pop` because it returns a new + * List rather than the removed value. Use `last()` to get the last value + * in this List. + * + * ```js + * List([ 1, 2, 3, 4 ]).pop() + * // List[ 1, 2, 3 ] + * ``` + * + * Note: `pop` can be used in `withMutations`. + */ + pop(): List; + + /** + * Returns a new List with the provided `values` prepended, shifting other + * values ahead to higher indices. + * + * + * ```js + * List([ 2, 3, 4]).unshift(1); + * // List [ 1, 2, 3, 4 ] + * ``` + * + * Note: `unshift` can be used in `withMutations`. + */ + unshift(...values: Array): List; + + /** + * Returns a new List with a size ones less than this List, excluding + * the first index in this List, shifting all other values to a lower index. + * + * Note: this differs from `Array#shift` because it returns a new + * List rather than the removed value. Use `first()` to get the first + * value in this List. + * + * + * ```js + * List([ 0, 1, 2, 3, 4 ]).shift(); + * // List [ 1, 2, 3, 4 ] + * ``` + * + * Note: `shift` can be used in `withMutations`. + */ + shift(): List; + + /** + * Returns a new List with an updated value at `index` with the return + * value of calling `updater` with the existing value, or `notSetValue` if + * `index` was not set. If called with a single argument, `updater` is + * called with the List itself. + * + * `index` may be a negative number, which indexes back from the end of the + * List. `v.update(-1)` updates the last item in the List. + * + * + * ```js + * const list = List([ 'a', 'b', 'c' ]) + * const result = list.update(2, val => val.toUpperCase()) + * // List [ "a", "b", "C" ] + * ``` + * + * This can be very useful as a way to "chain" a normal function into a + * sequence of methods. RxJS calls this "let" and lodash calls it "thru". + * + * For example, to sum a List after mapping and filtering: + * + * + * ```js + * function sum(collection) { + * return collection.reduce((sum, x) => sum + x, 0) + * } + * + * List([ 1, 2, 3 ]) + * .map(x => x + 1) + * .filter(x => x % 2 === 0) + * .update(sum) + * // 6 + * ``` + * + * Note: `update(index)` can be used in `withMutations`. + * + * @see `Map#update` + */ + update(index: number, notSetValue: T, updater: (value: T) => T): this; + update( + index: number, + updater: (value: T | undefined) => T | undefined + ): this; + update(updater: (value: this) => R): R; + + /** + * Returns a new List with size `size`. If `size` is less than this + * List's size, the new List will exclude values at the higher indices. + * If `size` is greater than this List's size, the new List will have + * undefined values for the newly available indices. + * + * When building a new List and the final size is known up front, `setSize` + * used in conjunction with `withMutations` may result in the more + * performant construction. + */ + setSize(size: number): List; + + // Deep persistent changes + + /** + * Returns a new List having set `value` at this `keyPath`. If any keys in + * `keyPath` do not exist, a new immutable Map will be created at that key. + * + * Index numbers are used as keys to determine the path to follow in + * the List. + * + * + * ```js + * const { List } = require('immutable') + * const list = List([ 0, 1, 2, List([ 3, 4 ])]) + * list.setIn([3, 0], 999); + * // List [ 0, 1, 2, List [ 999, 4 ] ] + * ``` + * + * Plain JavaScript Object or Arrays may be nested within an Immutable.js + * Collection, and setIn() can update those values as well, treating them + * immutably by creating new copies of those values with the changes applied. + * + * + * ```js + * const { List } = require('immutable') + * const list = List([ 0, 1, 2, { plain: 'object' }]) + * list.setIn([3, 'plain'], 'value'); + * // List([ 0, 1, 2, { plain: 'value' }]) + * ``` + * + * Note: `setIn` can be used in `withMutations`. + */ + setIn(keyPath: Iterable, value: unknown): this; + + /** + * Returns a new List having removed the value at this `keyPath`. If any + * keys in `keyPath` do not exist, no change will occur. + * + * + * ```js + * const { List } = require('immutable') + * const list = List([ 0, 1, 2, List([ 3, 4 ])]) + * list.deleteIn([3, 0]); + * // List [ 0, 1, 2, List [ 4 ] ] + * ``` + * + * Plain JavaScript Object or Arrays may be nested within an Immutable.js + * Collection, and removeIn() can update those values as well, treating them + * immutably by creating new copies of those values with the changes applied. + * + * + * ```js + * const { List } = require('immutable') + * const list = List([ 0, 1, 2, { plain: 'object' }]) + * list.removeIn([3, 'plain']); + * // List([ 0, 1, 2, {}]) + * ``` + * + * Note: `deleteIn` *cannot* be safely used in `withMutations`. + * + * @alias removeIn + */ + deleteIn(keyPath: Iterable): this; + removeIn(keyPath: Iterable): this; + + /** + * Note: `updateIn` can be used in `withMutations`. + * + * @see `Map#updateIn` + */ + updateIn( + keyPath: Iterable, + notSetValue: unknown, + updater: (value: unknown) => unknown + ): this; + updateIn( + keyPath: Iterable, + updater: (value: unknown) => unknown + ): this; + + /** + * Note: `mergeIn` can be used in `withMutations`. + * + * @see `Map#mergeIn` + */ + mergeIn(keyPath: Iterable, ...collections: Array): this; + + /** + * Note: `mergeDeepIn` can be used in `withMutations`. + * + * @see `Map#mergeDeepIn` + */ + mergeDeepIn( + keyPath: Iterable, + ...collections: Array + ): this; + + // Transient changes + + /** + * Note: Not all methods can be safely used on a mutable collection or within + * `withMutations`! Check the documentation for each method to see if it + * allows being used in `withMutations`. + * + * @see `Map#withMutations` + */ + withMutations(mutator: (mutable: this) => unknown): this; + + /** + * An alternative API for withMutations() + * + * Note: Not all methods can be safely used on a mutable collection or within + * `withMutations`! Check the documentation for each method to see if it + * allows being used in `withMutations`. + * + * @see `Map#asMutable` + */ + asMutable(): this; + + /** + * @see `Map#wasAltered` + */ + wasAltered(): boolean; + + /** + * @see `Map#asImmutable` + */ + asImmutable(): this; + + // Sequence algorithms + + /** + * Returns a new List with other values or collections concatenated to this one. + * + * Note: `concat` can be used in `withMutations`. + * + * @alias merge + */ + concat(...valuesOrCollections: Array | C>): List; + merge(...collections: Array>): List; + + /** + * Returns a new List with values passed through a + * `mapper` function. + * + * + * ```js + * List([ 1, 2 ]).map(x => 10 * x) + * // List [ 10, 20 ] + * ``` + */ + map( + mapper: (value: T, key: number, iter: this) => M, + context?: unknown + ): List; + + /** + * Flat-maps the List, returning a new List. + * + * Similar to `list.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: number, iter: this) => Iterable, + context?: unknown + ): List; + + /** + * Returns a new List with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, index: number, iter: this) => value is F, + context?: unknown + ): List; + filter( + predicate: (value: T, index: number, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new List with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: T, index: number, iter: this) => value is F, + context?: C + ): [List, List]; + partition( + predicate: (this: C, value: T, index: number, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * Returns a List "zipped" with the provided collection. + * + * Like `zipWith`, but using the default `zipper`: creating an `Array`. + * + * + * ```js + * const a = List([ 1, 2, 3 ]); + * const b = List([ 4, 5, 6 ]); + * const c = a.zip(b); // List [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] + * ``` + */ + zip(other: Collection): List<[T, U]>; + zip( + other: Collection, + other2: Collection + ): List<[T, U, V]>; + zip(...collections: Array>): List; + + /** + * Returns a List "zipped" with the provided collections. + * + * Unlike `zip`, `zipAll` continues zipping until the longest collection is + * exhausted. Missing values from shorter collections are filled with `undefined`. + * + * + * ```js + * const a = List([ 1, 2 ]); + * const b = List([ 3, 4, 5 ]); + * const c = a.zipAll(b); // List [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ] + * ``` + * + * Note: Since zipAll will return a collection as large as the largest + * input, some results may contain undefined values. TypeScript cannot + * account for these without cases (as of v2.5). + */ + zipAll(other: Collection): List<[T, U]>; + zipAll( + other: Collection, + other2: Collection + ): List<[T, U, V]>; + zipAll(...collections: Array>): List; + + /** + * Returns a List "zipped" with the provided collections by using a + * custom `zipper` function. + * + * + * ```js + * const a = List([ 1, 2, 3 ]); + * const b = List([ 4, 5, 6 ]); + * const c = a.zipWith((a, b) => a + b, b); + * // List [ 5, 7, 9 ] + * ``` + */ + zipWith( + zipper: (value: T, otherValue: U) => Z, + otherCollection: Collection + ): List; + zipWith( + zipper: (value: T, otherValue: U, thirdValue: V) => Z, + otherCollection: Collection, + thirdCollection: Collection + ): List; + zipWith( + zipper: (...values: Array) => Z, + ...collections: Array> + ): List; + + /** + * Returns a new List with its values shuffled thanks to the + * [Fisher–Yates](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle) + * algorithm. + * It uses Math.random, but you can provide your own random number generator. + */ + shuffle(random?: () => number): this; + } + + /** + * Immutable Map is an unordered Collection.Keyed of (key, value) pairs with + * `O(log32 N)` gets and `O(log32 N)` persistent sets. + * + * Iteration order of a Map is undefined, however is stable. Multiple + * iterations of the same Map will iterate in the same order. + * + * Map's keys can be of any type, and use `Immutable.is` to determine key + * equality. This allows the use of any value (including NaN) as a key. + * + * Because `Immutable.is` returns equality based on value semantics, and + * Immutable collections are treated as values, any Immutable collection may + * be used as a key. + * + * + * ```js + * const { Map, List } = require('immutable'); + * Map().set(List([ 1 ]), 'listofone').get(List([ 1 ])); + * // 'listofone' + * ``` + * + * Any JavaScript object may be used as a key, however strict identity is used + * to evaluate key equality. Two similar looking objects will represent two + * different keys. + * + * Implemented by a hash-array mapped trie. + */ + namespace Map { + /** + * True if the provided value is a Map + * + * + * ```js + * const { Map } = require('immutable') + * Map.isMap({}) // false + * Map.isMap(Map()) // true + * ``` + */ + function isMap(maybeMap: unknown): maybeMap is Map; + } + + /** + * Creates a new Immutable Map. + * + * Created with the same key value pairs as the provided Collection.Keyed or + * JavaScript Object or expects a Collection of [K, V] tuple entries. + * + * Note: `Map` is a factory function and not a class, and does not use the + * `new` keyword during construction. + * + * + * ```js + * const { Map } = require('immutable') + * Map({ key: "value" }) + * Map([ [ "key", "value" ] ]) + * ``` + * + * Keep in mind, when using JS objects to construct Immutable Maps, that + * JavaScript Object properties are always strings, even if written in a + * quote-less shorthand, while Immutable Maps accept keys of any type. + * + * + * ```js + * let obj = { 1: "one" } + * Object.keys(obj) // [ "1" ] + * assert.equal(obj["1"], obj[1]) // "one" === "one" + * + * let map = Map(obj) + * assert.notEqual(map.get("1"), map.get(1)) // "one" !== undefined + * ``` + * + * Property access for JavaScript Objects first converts the key to a string, + * but since Immutable Map keys can be of any type the argument to `get()` is + * not altered. + */ + function Map(collection?: Iterable<[K, V]>): Map; + function Map(obj: R): MapOf; + function Map(obj: { [key: string]: V }): Map; + function Map(obj: { [P in K]?: V }): Map; + + /** + * Represent a Map constructed by an object + * + * @ignore + */ + interface MapOf + extends Map { + /** + * Returns the value associated with the provided key, or notSetValue if + * the Collection does not contain this key. + * + * Note: it is possible a key may be associated with an `undefined` value, + * so if `notSetValue` is not provided and this method returns `undefined`, + * that does not guarantee the key was not found. + */ + get(key: K, notSetValue?: unknown): R[K]; + get(key: unknown, notSetValue: NSV): NSV; + + // TODO `` can be used after dropping support for TypeScript 4.x + // reference: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#const-type-parameters + // after this change, `as const` assertions can be remove from the type tests + getIn

>( + searchKeyPath: [...P], + notSetValue?: unknown + ): RetrievePath; + + set(key: K, value: R[K]): this; + + update(updater: (value: this) => this): this; + update(key: K, updater: (value: R[K]) => R[K]): this; + update( + key: K, + notSetValue: NSV, + updater: (value: R[K]) => R[K] + ): this; + + // Possible best type is MapOf> but Omit seems to broke other function calls + // and generate recursion error with other methods (update, merge, etc.) until those functions are defined in MapOf + delete( + key: K + ): Extract extends never ? never : this; + remove( + key: K + ): Extract extends never ? never : this; + + toJS(): { [K in keyof R]: DeepCopy }; + + toJSON(): { [K in keyof R]: R[K] }; + } + + // Loosely based off of this work. + // https://github.com/immutable-js/immutable-js/issues/1462#issuecomment-584123268 + + /** + * @ignore + * Convert an immutable type to the equivalent plain TS type + * - MapOf -> object + * - List -> Array + */ + type GetNativeType = + S extends MapOf ? T : S extends List ? Array : S; + + /** @ignore */ + type Head> = T extends [ + infer H, + ...Array, + ] + ? H + : never; + /** @ignore */ + type Tail> = T extends [unknown, ...infer I] + ? I + : Array; + /** @ignore */ + type RetrievePathReducer< + T, + C, + L extends ReadonlyArray, + NT = GetNativeType, + > = + // we can not retrieve a path from a primitive type + T extends string | number | boolean | null | undefined + ? never + : C extends keyof NT + ? L extends [] // L extends [] means we are at the end of the path, lets return the current type + ? NT[C] + : // we are not at the end of the path, lets continue with the next key + RetrievePathReducer, Tail> + : // C is not a "key" of NT, so the path is invalid + never; + + /** @ignore */ + type RetrievePath> = P extends [] + ? P + : RetrievePathReducer, Tail

>; + + interface Map extends Collection.Keyed { + /** + * The number of entries in this Map. + */ + readonly size: number; + + // Persistent changes + + /** + * Returns a new Map also containing the new key, value pair. If an equivalent + * key already exists in this Map, it will be replaced. + * + * + * ```js + * const { Map } = require('immutable') + * const originalMap = Map() + * const newerMap = originalMap.set('key', 'value') + * const newestMap = newerMap.set('key', 'newer value') + * + * originalMap + * // Map {} + * newerMap + * // Map { "key": "value" } + * newestMap + * // Map { "key": "newer value" } + * ``` + * + * Note: `set` can be used in `withMutations`. + */ + set(key: K, value: V): this; + + /** + * Returns a new Map which excludes this `key`. + * + * Note: `delete` cannot be safely used in IE8, but is provided to mirror + * the ES6 collection API. + * + * + * ```js + * const { Map } = require('immutable') + * const originalMap = Map({ + * key: 'value', + * otherKey: 'other value' + * }) + * // Map { "key": "value", "otherKey": "other value" } + * originalMap.delete('otherKey') + * // Map { "key": "value" } + * ``` + * + * Note: `delete` can be used in `withMutations`. + * + * @alias remove + */ + delete(key: K): this; + remove(key: K): this; + + /** + * Returns a new Map which excludes the provided `keys`. + * + * + * ```js + * const { Map } = require('immutable') + * const names = Map({ a: "Aaron", b: "Barry", c: "Connor" }) + * names.deleteAll([ 'a', 'c' ]) + * // Map { "b": "Barry" } + * ``` + * + * Note: `deleteAll` can be used in `withMutations`. + * + * @alias removeAll + */ + deleteAll(keys: Iterable): this; + removeAll(keys: Iterable): this; + + /** + * Returns a new Map containing no keys or values. + * + * + * ```js + * const { Map } = require('immutable') + * Map({ key: 'value' }).clear() + * // Map {} + * ``` + * + * Note: `clear` can be used in `withMutations`. + */ + clear(): this; + + /** + * Returns a new Map having updated the value at this `key` with the return + * value of calling `updater` with the existing value. + * + * Similar to: `map.set(key, updater(map.get(key)))`. + * + * + * ```js + * const { Map } = require('immutable') + * const aMap = Map({ key: 'value' }) + * const newMap = aMap.update('key', value => value + value) + * // Map { "key": "valuevalue" } + * ``` + * + * This is most commonly used to call methods on collections within a + * structure of data. For example, in order to `.push()` onto a nested `List`, + * `update` and `push` can be used together: + * + * + * ```js + * const aMap = Map({ nestedList: List([ 1, 2, 3 ]) }) + * const newMap = aMap.update('nestedList', list => list.push(4)) + * // Map { "nestedList": List [ 1, 2, 3, 4 ] } + * ``` + * + * When a `notSetValue` is provided, it is provided to the `updater` + * function when the value at the key does not exist in the Map. + * + * + * ```js + * const aMap = Map({ key: 'value' }) + * const newMap = aMap.update('noKey', 'no value', value => value + value) + * // Map { "key": "value", "noKey": "no valueno value" } + * ``` + * + * However, if the `updater` function returns the same value it was called + * with, then no change will occur. This is still true if `notSetValue` + * is provided. + * + * + * ```js + * const aMap = Map({ apples: 10 }) + * const newMap = aMap.update('oranges', 0, val => val) + * // Map { "apples": 10 } + * assert.strictEqual(newMap, map); + * ``` + * + * For code using ES2015 or later, using `notSetValue` is discourged in + * favor of function parameter default values. This helps to avoid any + * potential confusion with identify functions as described above. + * + * The previous example behaves differently when written with default values: + * + * + * ```js + * const aMap = Map({ apples: 10 }) + * const newMap = aMap.update('oranges', (val = 0) => val) + * // Map { "apples": 10, "oranges": 0 } + * ``` + * + * If no key is provided, then the `updater` function return value is + * returned as well. + * + * + * ```js + * const aMap = Map({ key: 'value' }) + * const result = aMap.update(aMap => aMap.get('key')) + * // "value" + * ``` + * + * This can be very useful as a way to "chain" a normal function into a + * sequence of methods. RxJS calls this "let" and lodash calls it "thru". + * + * For example, to sum the values in a Map + * + * + * ```js + * function sum(collection) { + * return collection.reduce((sum, x) => sum + x, 0) + * } + * + * Map({ x: 1, y: 2, z: 3 }) + * .map(x => x + 1) + * .filter(x => x % 2 === 0) + * .update(sum) + * // 6 + * ``` + * + * Note: `update(key)` can be used in `withMutations`. + */ + update(key: K, notSetValue: V, updater: (value: V) => V): this; + update(key: K, updater: (value: V | undefined) => V | undefined): this; + update(updater: (value: this) => R): R; + + /** + * Returns a new Map resulting from merging the provided Collections + * (or JS objects) into this Map. In other words, this takes each entry of + * each collection and sets it on this Map. + * + * Note: Values provided to `merge` are shallowly converted before being + * merged. No nested values are altered. + * + * + * ```js + * const { Map } = require('immutable') + * const one = Map({ a: 10, b: 20, c: 30 }) + * const two = Map({ b: 40, a: 50, d: 60 }) + * one.merge(two) // Map { "a": 50, "b": 40, "c": 30, "d": 60 } + * two.merge(one) // Map { "b": 20, "a": 10, "d": 60, "c": 30 } + * ``` + * + * Note: `merge` can be used in `withMutations`. + * + * @alias concat + */ + merge( + ...collections: Array> + ): Map | VC>; + merge( + ...collections: Array<{ [key: string]: C }> + ): Map | C>; + + concat( + ...collections: Array> + ): Map | VC>; + concat( + ...collections: Array<{ [key: string]: C }> + ): Map | C>; + + /** + * Like `merge()`, `mergeWith()` returns a new Map resulting from merging + * the provided Collections (or JS objects) into this Map, but uses the + * `merger` function for dealing with conflicts. + * + * + * ```js + * const { Map } = require('immutable') + * const one = Map({ a: 10, b: 20, c: 30 }) + * const two = Map({ b: 40, a: 50, d: 60 }) + * one.mergeWith((oldVal, newVal) => oldVal / newVal, two) + * // { "a": 0.2, "b": 0.5, "c": 30, "d": 60 } + * two.mergeWith((oldVal, newVal) => oldVal / newVal, one) + * // { "b": 2, "a": 5, "d": 60, "c": 30 } + * ``` + * + * Note: `mergeWith` can be used in `withMutations`. + */ + mergeWith( + merger: (oldVal: V, newVal: VC, key: K) => VCC, + ...collections: Array> + ): Map; + mergeWith( + merger: (oldVal: V, newVal: C, key: string) => CC, + ...collections: Array<{ [key: string]: C }> + ): Map; + + /** + * Like `merge()`, but when two compatible collections are encountered with + * the same key, it merges them as well, recursing deeply through the nested + * data. Two collections are considered to be compatible (and thus will be + * merged together) if they both fall into one of three categories: keyed + * (e.g., `Map`s, `Record`s, and objects), indexed (e.g., `List`s and + * arrays), or set-like (e.g., `Set`s). If they fall into separate + * categories, `mergeDeep` will replace the existing collection with the + * collection being merged in. This behavior can be customized by using + * `mergeDeepWith()`. + * + * Note: Indexed and set-like collections are merged using + * `concat()`/`union()` and therefore do not recurse. + * + * + * ```js + * const { Map } = require('immutable') + * const one = Map({ a: Map({ x: 10, y: 10 }), b: Map({ x: 20, y: 50 }) }) + * const two = Map({ a: Map({ x: 2 }), b: Map({ y: 5 }), c: Map({ z: 3 }) }) + * one.mergeDeep(two) + * // Map { + * // "a": Map { "x": 2, "y": 10 }, + * // "b": Map { "x": 20, "y": 5 }, + * // "c": Map { "z": 3 } + * // } + * ``` + * + * Note: `mergeDeep` can be used in `withMutations`. + */ + mergeDeep( + ...collections: Array> + ): Map; + mergeDeep( + ...collections: Array<{ [key: string]: C }> + ): Map; + + /** + * Like `mergeDeep()`, but when two non-collections or incompatible + * collections are encountered at the same key, it uses the `merger` + * function to determine the resulting value. Collections are considered + * incompatible if they fall into separate categories between keyed, + * indexed, and set-like. + * + * + * ```js + * const { Map } = require('immutable') + * const one = Map({ a: Map({ x: 10, y: 10 }), b: Map({ x: 20, y: 50 }) }) + * const two = Map({ a: Map({ x: 2 }), b: Map({ y: 5 }), c: Map({ z: 3 }) }) + * one.mergeDeepWith((oldVal, newVal) => oldVal / newVal, two) + * // Map { + * // "a": Map { "x": 5, "y": 10 }, + * // "b": Map { "x": 20, "y": 10 }, + * // "c": Map { "z": 3 } + * // } + * ``` + * + * Note: `mergeDeepWith` can be used in `withMutations`. + */ + mergeDeepWith( + merger: (oldVal: unknown, newVal: unknown, key: unknown) => unknown, + ...collections: Array | { [key: string]: V }> + ): this; + + // Deep persistent changes + + /** + * Returns a new Map having set `value` at this `keyPath`. If any keys in + * `keyPath` do not exist, a new immutable Map will be created at that key. + * + * + * ```js + * const { Map } = require('immutable') + * const originalMap = Map({ + * subObject: Map({ + * subKey: 'subvalue', + * subSubObject: Map({ + * subSubKey: 'subSubValue' + * }) + * }) + * }) + * + * const newMap = originalMap.setIn(['subObject', 'subKey'], 'ha ha!') + * // Map { + * // "subObject": Map { + * // "subKey": "ha ha!", + * // "subSubObject": Map { "subSubKey": "subSubValue" } + * // } + * // } + * + * const newerMap = originalMap.setIn( + * ['subObject', 'subSubObject', 'subSubKey'], + * 'ha ha ha!' + * ) + * // Map { + * // "subObject": Map { + * // "subKey": "subvalue", + * // "subSubObject": Map { "subSubKey": "ha ha ha!" } + * // } + * // } + * ``` + * + * Plain JavaScript Object or Arrays may be nested within an Immutable.js + * Collection, and setIn() can update those values as well, treating them + * immutably by creating new copies of those values with the changes applied. + * + * + * ```js + * const { Map } = require('immutable') + * const originalMap = Map({ + * subObject: { + * subKey: 'subvalue', + * subSubObject: { + * subSubKey: 'subSubValue' + * } + * } + * }) + * + * originalMap.setIn(['subObject', 'subKey'], 'ha ha!') + * // Map { + * // "subObject": { + * // subKey: "ha ha!", + * // subSubObject: { subSubKey: "subSubValue" } + * // } + * // } + * ``` + * + * If any key in the path exists but cannot be updated (such as a primitive + * like number or a custom Object like Date), an error will be thrown. + * + * Note: `setIn` can be used in `withMutations`. + */ + setIn(keyPath: Iterable, value: unknown): this; + + /** + * Returns a new Map having removed the value at this `keyPath`. If any keys + * in `keyPath` do not exist, no change will occur. + * + * Note: `deleteIn` can be used in `withMutations`. + * + * @alias removeIn + */ + deleteIn(keyPath: Iterable): this; + removeIn(keyPath: Iterable): this; + + /** + * Returns a new Map having applied the `updater` to the entry found at the + * keyPath. + * + * This is most commonly used to call methods on collections nested within a + * structure of data. For example, in order to `.push()` onto a nested `List`, + * `updateIn` and `push` can be used together: + * + * + * ```js + * const { Map, List } = require('immutable') + * const map = Map({ inMap: Map({ inList: List([ 1, 2, 3 ]) }) }) + * const newMap = map.updateIn(['inMap', 'inList'], list => list.push(4)) + * // Map { "inMap": Map { "inList": List [ 1, 2, 3, 4 ] } } + * ``` + * + * If any keys in `keyPath` do not exist, new Immutable `Map`s will + * be created at those keys. If the `keyPath` does not already contain a + * value, the `updater` function will be called with `notSetValue`, if + * provided, otherwise `undefined`. + * + * + * ```js + * const map = Map({ a: Map({ b: Map({ c: 10 }) }) }) + * const newMap = map.updateIn(['a', 'b', 'c'], val => val * 2) + * // Map { "a": Map { "b": Map { "c": 20 } } } + * ``` + * + * If the `updater` function returns the same value it was called with, then + * no change will occur. This is still true if `notSetValue` is provided. + * + * + * ```js + * const map = Map({ a: Map({ b: Map({ c: 10 }) }) }) + * const newMap = map.updateIn(['a', 'b', 'x'], 100, val => val) + * // Map { "a": Map { "b": Map { "c": 10 } } } + * assert.strictEqual(newMap, aMap) + * ``` + * + * For code using ES2015 or later, using `notSetValue` is discourged in + * favor of function parameter default values. This helps to avoid any + * potential confusion with identify functions as described above. + * + * The previous example behaves differently when written with default values: + * + * + * ```js + * const map = Map({ a: Map({ b: Map({ c: 10 }) }) }) + * const newMap = map.updateIn(['a', 'b', 'x'], (val = 100) => val) + * // Map { "a": Map { "b": Map { "c": 10, "x": 100 } } } + * ``` + * + * Plain JavaScript Object or Arrays may be nested within an Immutable.js + * Collection, and updateIn() can update those values as well, treating them + * immutably by creating new copies of those values with the changes applied. + * + * + * ```js + * const map = Map({ a: { b: { c: 10 } } }) + * const newMap = map.updateIn(['a', 'b', 'c'], val => val * 2) + * // Map { "a": { b: { c: 20 } } } + * ``` + * + * If any key in the path exists but cannot be updated (such as a primitive + * like number or a custom Object like Date), an error will be thrown. + * + * Note: `updateIn` can be used in `withMutations`. + */ + updateIn( + keyPath: Iterable, + notSetValue: unknown, + updater: (value: unknown) => unknown + ): this; + updateIn( + keyPath: Iterable, + updater: (value: unknown) => unknown + ): this; + + /** + * A combination of `updateIn` and `merge`, returning a new Map, but + * performing the merge at a point arrived at by following the keyPath. + * In other words, these two lines are equivalent: + * + * ```js + * map.updateIn(['a', 'b', 'c'], abc => abc.merge(y)) + * map.mergeIn(['a', 'b', 'c'], y) + * ``` + * + * Note: `mergeIn` can be used in `withMutations`. + */ + mergeIn(keyPath: Iterable, ...collections: Array): this; + + /** + * A combination of `updateIn` and `mergeDeep`, returning a new Map, but + * performing the deep merge at a point arrived at by following the keyPath. + * In other words, these two lines are equivalent: + * + * ```js + * map.updateIn(['a', 'b', 'c'], abc => abc.mergeDeep(y)) + * map.mergeDeepIn(['a', 'b', 'c'], y) + * ``` + * + * Note: `mergeDeepIn` can be used in `withMutations`. + */ + mergeDeepIn( + keyPath: Iterable, + ...collections: Array + ): this; + + // Transient changes + + /** + * Every time you call one of the above functions, a new immutable Map is + * created. If a pure function calls a number of these to produce a final + * return value, then a penalty on performance and memory has been paid by + * creating all of the intermediate immutable Maps. + * + * If you need to apply a series of mutations to produce a new immutable + * Map, `withMutations()` creates a temporary mutable copy of the Map which + * can apply mutations in a highly performant manner. In fact, this is + * exactly how complex mutations like `merge` are done. + * + * As an example, this results in the creation of 2, not 4, new Maps: + * + * + * ```js + * const { Map } = require('immutable') + * const map1 = Map() + * const map2 = map1.withMutations(map => { + * map.set('a', 1).set('b', 2).set('c', 3) + * }) + * assert.equal(map1.size, 0) + * assert.equal(map2.size, 3) + * ``` + * + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Read the documentation for each method to see if it + * is safe to use in `withMutations`. + */ + withMutations(mutator: (mutable: this) => unknown): this; + + /** + * Another way to avoid creation of intermediate Immutable maps is to create + * a mutable copy of this collection. Mutable copies *always* return `this`, + * and thus shouldn't be used for equality. Your function should never return + * a mutable copy of a collection, only use it internally to create a new + * collection. + * + * If possible, use `withMutations` to work with temporary mutable copies as + * it provides an easier to use API and considers many common optimizations. + * + * Note: if the collection is already mutable, `asMutable` returns itself. + * + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Read the documentation for each method to see if it + * is safe to use in `withMutations`. + * + * @see `Map#asImmutable` + */ + asMutable(): this; + + /** + * Returns true if this is a mutable copy (see `asMutable()`) and mutative + * alterations have been applied. + * + * @see `Map#asMutable` + */ + wasAltered(): boolean; + + /** + * The yin to `asMutable`'s yang. Because it applies to mutable collections, + * this operation is *mutable* and may return itself (though may not + * return itself, i.e. if the result is an empty collection). Once + * performed, the original mutable copy must no longer be mutated since it + * may be the immutable result. + * + * If possible, use `withMutations` to work with temporary mutable copies as + * it provides an easier to use API and considers many common optimizations. + * + * @see `Map#asMutable` + */ + asImmutable(): this; + + // Sequence algorithms + + /** + * Returns a new Map with values passed through a + * `mapper` function. + * + * Map({ a: 1, b: 2 }).map(x => 10 * x) + * // Map { a: 10, b: 20 } + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): Map; + + /** + * @see Collection.Keyed.mapKeys + */ + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: unknown + ): Map; + + /** + * @see Collection.Keyed.mapEntries + */ + mapEntries( + mapper: ( + entry: [K, V], + index: number, + iter: this + ) => [KM, VM] | undefined, + context?: unknown + ): Map; + + /** + * Flat-maps the Map, returning a new Map. + * + * Similar to `data.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: unknown + ): Map; + + /** + * Returns a new Map with only the entries for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: V, key: K, iter: this) => value is F, + context?: unknown + ): Map; + filter( + predicate: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new Map with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: V, key: K, iter: this) => value is F, + context?: C + ): [Map, Map]; + partition( + predicate: (this: C, value: V, key: K, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * @see Collection.Keyed.flip + */ + flip(): Map; + + /** + * Returns an OrderedMap of the same type which includes the same entries, + * stably sorted by using a `comparator`. + * + * If a `comparator` is not provided, a default comparator uses `<` and `>`. + * + * `comparator(valueA, valueB)`: + * + * * Returns `0` if the elements should not be swapped. + * * Returns `-1` (or any negative number) if `valueA` comes before `valueB` + * * Returns `1` (or any positive number) if `valueA` comes after `valueB` + * * Alternatively, can return a value of the `PairSorting` enum type + * * Is pure, i.e. it must always return the same value for the same pair + * of values. + * + * + * ```js + * const { Map } = require('immutable') + * Map({ "c": 3, "a": 1, "b": 2 }).sort((a, b) => { + * if (a < b) { return -1; } + * if (a > b) { return 1; } + * if (a === b) { return 0; } + * }); + * // OrderedMap { "a": 1, "b": 2, "c": 3 } + * ``` + * + * Note: `sort()` Always returns a new instance, even if the original was + * already sorted. + * + * Note: This is always an eager operation. + */ + sort(comparator?: Comparator): this & OrderedMap; + + /** + * Like `sort`, but also accepts a `comparatorValueMapper` which allows for + * sorting by more sophisticated means: + * + * + * ```js + * const { Map } = require('immutable') + * const beattles = Map({ + * John: { name: "Lennon" }, + * Paul: { name: "McCartney" }, + * George: { name: "Harrison" }, + * Ringo: { name: "Starr" }, + * }); + * beattles.sortBy(member => member.name); + * ``` + * + * Note: `sortBy()` Always returns a new instance, even if the original was + * already sorted. + * + * Note: This is always an eager operation. + */ + sortBy( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: (valueA: C, valueB: C) => number + ): this & OrderedMap; + } + + /** + * A type of Map that has the additional guarantee that the iteration order of + * entries will be the order in which they were set(). + * + * The iteration behavior of OrderedMap is the same as native ES6 Map and + * JavaScript Object. + * + * Note that `OrderedMap` are more expensive than non-ordered `Map` and may + * consume more memory. `OrderedMap#set` is amortized O(log32 N), but not + * stable. + */ + namespace OrderedMap { + /** + * True if the provided value is an OrderedMap. + */ + function isOrderedMap( + maybeOrderedMap: unknown + ): maybeOrderedMap is OrderedMap; + } + + /** + * Creates a new Immutable OrderedMap. + * + * Created with the same key value pairs as the provided Collection.Keyed or + * JavaScript Object or expects a Collection of [K, V] tuple entries. + * + * The iteration order of key-value pairs provided to this constructor will + * be preserved in the OrderedMap. + * + * let newOrderedMap = OrderedMap({key: "value"}) + * let newOrderedMap = OrderedMap([["key", "value"]]) + * + * Note: `OrderedMap` is a factory function and not a class, and does not use + * the `new` keyword during construction. + */ + function OrderedMap(collection?: Iterable<[K, V]>): OrderedMap; + function OrderedMap(obj: { [key: string]: V }): OrderedMap; + + interface OrderedMap extends Map, OrderedCollection<[K, V]> { + /** + * The number of entries in this OrderedMap. + */ + readonly size: number; + + /** + * Returns a new OrderedMap also containing the new key, value pair. If an + * equivalent key already exists in this OrderedMap, it will be replaced + * while maintaining the existing order. + * + * + * ```js + * const { OrderedMap } = require('immutable') + * const originalMap = OrderedMap({a:1, b:1, c:1}) + * const updatedMap = originalMap.set('b', 2) + * + * originalMap + * // OrderedMap {a: 1, b: 1, c: 1} + * updatedMap + * // OrderedMap {a: 1, b: 2, c: 1} + * ``` + * + * Note: `set` can be used in `withMutations`. + */ + set(key: K, value: V): this; + + /** + * Returns a new OrderedMap resulting from merging the provided Collections + * (or JS objects) into this OrderedMap. In other words, this takes each + * entry of each collection and sets it on this OrderedMap. + * + * Note: Values provided to `merge` are shallowly converted before being + * merged. No nested values are altered. + * + * + * ```js + * const { OrderedMap } = require('immutable') + * const one = OrderedMap({ a: 10, b: 20, c: 30 }) + * const two = OrderedMap({ b: 40, a: 50, d: 60 }) + * one.merge(two) // OrderedMap { "a": 50, "b": 40, "c": 30, "d": 60 } + * two.merge(one) // OrderedMap { "b": 20, "a": 10, "d": 60, "c": 30 } + * ``` + * + * Note: `merge` can be used in `withMutations`. + * + * @alias concat + */ + merge( + ...collections: Array> + ): OrderedMap | VC>; + merge( + ...collections: Array<{ [key: string]: C }> + ): OrderedMap | C>; + + concat( + ...collections: Array> + ): OrderedMap | VC>; + concat( + ...collections: Array<{ [key: string]: C }> + ): OrderedMap | C>; + + mergeWith( + merger: (oldVal: V, newVal: VC, key: K) => VCC, + ...collections: Array> + ): OrderedMap; + mergeWith( + merger: (oldVal: V, newVal: C, key: string) => CC, + ...collections: Array<{ [key: string]: C }> + ): OrderedMap; + + mergeDeep( + ...collections: Array> + ): OrderedMap; + mergeDeep( + ...collections: Array<{ [key: string]: C }> + ): OrderedMap; + + // Sequence algorithms + + /** + * Returns a new OrderedMap with values passed through a + * `mapper` function. + * + * OrderedMap({ a: 1, b: 2 }).map(x => 10 * x) + * // OrderedMap { "a": 10, "b": 20 } + * + * Note: `map()` always returns a new instance, even if it produced the same + * value at every step. + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): OrderedMap; + + /** + * @see Collection.Keyed.mapKeys + */ + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: unknown + ): OrderedMap; + + /** + * @see Collection.Keyed.mapEntries + */ + mapEntries( + mapper: ( + entry: [K, V], + index: number, + iter: this + ) => [KM, VM] | undefined, + context?: unknown + ): OrderedMap; + + /** + * Flat-maps the OrderedMap, returning a new OrderedMap. + * + * Similar to `data.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: unknown + ): OrderedMap; + + /** + * Returns a new OrderedMap with only the entries for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: V, key: K, iter: this) => value is F, + context?: unknown + ): OrderedMap; + filter( + predicate: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new OrderedMap with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: V, key: K, iter: this) => value is F, + context?: C + ): [OrderedMap, OrderedMap]; + partition( + predicate: (this: C, value: V, key: K, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * @see Collection.Keyed.flip + */ + flip(): OrderedMap; + } + + /** + * A Collection of unique values with `O(log32 N)` adds and has. + * + * When iterating a Set, the entries will be (value, value) pairs. Iteration + * order of a Set is undefined, however is stable. Multiple iterations of the + * same Set will iterate in the same order. + * + * Set values, like Map keys, may be of any type. Equality is determined using + * `Immutable.is`, enabling Sets to uniquely include other Immutable + * collections, custom value types, and NaN. + */ + namespace Set { + /** + * True if the provided value is a Set + */ + function isSet(maybeSet: unknown): maybeSet is Set; + + /** + * Creates a new Set containing `values`. + */ + function of(...values: Array): Set; + + /** + * `Set.fromKeys()` creates a new immutable Set containing the keys from + * this Collection or JavaScript Object. + */ + function fromKeys(iter: Collection.Keyed): Set; + function fromKeys(iter: Collection): Set; + function fromKeys(obj: { [key: string]: unknown }): Set; + + /** + * `Set.intersect()` creates a new immutable Set that is the intersection of + * a collection of other sets. + * + * ```js + * const { Set } = require('immutable') + * const intersected = Set.intersect([ + * Set([ 'a', 'b', 'c' ]) + * Set([ 'c', 'a', 't' ]) + * ]) + * // Set [ "a", "c" ] + * ``` + */ + function intersect(sets: Iterable>): Set; + + /** + * `Set.union()` creates a new immutable Set that is the union of a + * collection of other sets. + * + * ```js + * const { Set } = require('immutable') + * const unioned = Set.union([ + * Set([ 'a', 'b', 'c' ]) + * Set([ 'c', 'a', 't' ]) + * ]) + * // Set [ "a", "b", "c", "t" ] + * ``` + */ + function union(sets: Iterable>): Set; + } + + /** + * Create a new immutable Set containing the values of the provided + * collection-like. + * + * Note: `Set` is a factory function and not a class, and does not use the + * `new` keyword during construction. + */ + function Set(collection?: Iterable | ArrayLike): Set; + + interface Set extends Collection.Set { + /** + * The number of items in this Set. + */ + readonly size: number; + + // Persistent changes + + /** + * Returns a new Set which also includes this value. + * + * Note: `add` can be used in `withMutations`. + */ + add(value: T): this; + + /** + * Returns a new Set which excludes this value. + * + * Note: `delete` can be used in `withMutations`. + * + * Note: `delete` **cannot** be safely used in IE8, use `remove` if + * supporting old browsers. + * + * @alias remove + */ + delete(value: T): this; + remove(value: T): this; + + /** + * Returns a new Set containing no values. + * + * Note: `clear` can be used in `withMutations`. + */ + clear(): this; + + /** + * Returns a Set including any value from `collections` that does not already + * exist in this Set. + * + * Note: `union` can be used in `withMutations`. + * @alias merge + * @alias concat + */ + union(...collections: Array>): Set; + merge(...collections: Array>): Set; + concat(...collections: Array>): Set; + + /** + * Returns a Set which has removed any values not also contained + * within `collections`. + * + * Note: `intersect` can be used in `withMutations`. + */ + intersect(...collections: Array>): this; + + /** + * Returns a Set excluding any values contained within `collections`. + * + * + * ```js + * const { OrderedSet } = require('immutable') + * OrderedSet([ 1, 2, 3 ]).subtract([1, 3]) + * // OrderedSet [2] + * ``` + * + * Note: `subtract` can be used in `withMutations`. + */ + subtract(...collections: Array>): this; + + // Transient changes + + /** + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Check the documentation for each method to see if it + * mentions being safe to use in `withMutations`. + * + * @see `Map#withMutations` + */ + withMutations(mutator: (mutable: this) => unknown): this; + + /** + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Check the documentation for each method to see if it + * mentions being safe to use in `withMutations`. + * + * @see `Map#asMutable` + */ + asMutable(): this; + + /** + * @see `Map#wasAltered` + */ + wasAltered(): boolean; + + /** + * @see `Map#asImmutable` + */ + asImmutable(): this; + + // Sequence algorithms + + /** + * Returns a new Set with values passed through a + * `mapper` function. + * + * Set([1,2]).map(x => 10 * x) + * // Set [10,20] + */ + map( + mapper: (value: T, key: T, iter: this) => M, + context?: unknown + ): Set; + + /** + * Flat-maps the Set, returning a new Set. + * + * Similar to `set.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: T, iter: this) => Iterable, + context?: unknown + ): Set; + + /** + * Returns a new Set with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, key: T, iter: this) => value is F, + context?: unknown + ): Set; + filter( + predicate: (value: T, key: T, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new Set with the values for which the `predicate` function + * returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: T, key: T, iter: this) => value is F, + context?: C + ): [Set, Set]; + partition( + predicate: (this: C, value: T, key: T, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * Returns an OrderedSet of the same type which includes the same entries, + * stably sorted by using a `comparator`. + * + * If a `comparator` is not provided, a default comparator uses `<` and `>`. + * + * `comparator(valueA, valueB)`: + * + * * Returns `0` if the elements should not be swapped. + * * Returns `-1` (or any negative number) if `valueA` comes before `valueB` + * * Returns `1` (or any positive number) if `valueA` comes after `valueB` + * * Alternatively, can return a value of the `PairSorting` enum type + * * Is pure, i.e. it must always return the same value for the same pair + * of values. + * + * + * ```js + * const { Set } = require('immutable') + * Set(['b', 'a', 'c']).sort((a, b) => { + * if (a < b) { return -1; } + * if (a > b) { return 1; } + * if (a === b) { return 0; } + * }); + * // OrderedSet { "a":, "b", "c" } + * ``` + * + * Note: `sort()` Always returns a new instance, even if the original was + * already sorted. + * + * Note: This is always an eager operation. + */ + sort(comparator?: Comparator): this & OrderedSet; + + /** + * Like `sort`, but also accepts a `comparatorValueMapper` which allows for + * sorting by more sophisticated means: + * + * + * ```js + * const { Set } = require('immutable') + * const beattles = Set([ + * { name: "Lennon" }, + * { name: "McCartney" }, + * { name: "Harrison" }, + * { name: "Starr" }, + * ]); + * beattles.sortBy(member => member.name); + * ``` + * + * Note: `sortBy()` Always returns a new instance, even if the original was + * already sorted. + * + * Note: This is always an eager operation. + */ + sortBy( + comparatorValueMapper: (value: T, key: T, iter: this) => C, + comparator?: (valueA: C, valueB: C) => number + ): this & OrderedSet; + } + + /** + * A type of Set that has the additional guarantee that the iteration order of + * values will be the order in which they were `add`ed. + * + * The iteration behavior of OrderedSet is the same as native ES6 Set. + * + * Note that `OrderedSet` are more expensive than non-ordered `Set` and may + * consume more memory. `OrderedSet#add` is amortized O(log32 N), but not + * stable. + */ + namespace OrderedSet { + /** + * True if the provided value is an OrderedSet. + */ + function isOrderedSet( + maybeOrderedSet: unknown + ): maybeOrderedSet is OrderedSet; + + /** + * Creates a new OrderedSet containing `values`. + */ + function of(...values: Array): OrderedSet; + + /** + * `OrderedSet.fromKeys()` creates a new immutable OrderedSet containing + * the keys from this Collection or JavaScript Object. + */ + function fromKeys(iter: Collection.Keyed): OrderedSet; + function fromKeys(iter: Collection): OrderedSet; + function fromKeys(obj: { [key: string]: unknown }): OrderedSet; + } + + /** + * Create a new immutable OrderedSet containing the values of the provided + * collection-like. + * + * Note: `OrderedSet` is a factory function and not a class, and does not use + * the `new` keyword during construction. + */ + function OrderedSet( + collection?: Iterable | ArrayLike + ): OrderedSet; + + interface OrderedSet extends Set, OrderedCollection { + /** + * The number of items in this OrderedSet. + */ + readonly size: number; + + /** + * Returns an OrderedSet including any value from `collections` that does + * not already exist in this OrderedSet. + * + * Note: `union` can be used in `withMutations`. + * @alias merge + * @alias concat + */ + union(...collections: Array>): OrderedSet; + merge(...collections: Array>): OrderedSet; + concat(...collections: Array>): OrderedSet; + + // Sequence algorithms + + /** + * Returns a new Set with values passed through a + * `mapper` function. + * + * OrderedSet([ 1, 2 ]).map(x => 10 * x) + * // OrderedSet [10, 20] + */ + map( + mapper: (value: T, key: T, iter: this) => M, + context?: unknown + ): OrderedSet; + + /** + * Flat-maps the OrderedSet, returning a new OrderedSet. + * + * Similar to `set.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: T, iter: this) => Iterable, + context?: unknown + ): OrderedSet; + + /** + * Returns a new OrderedSet with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, key: T, iter: this) => value is F, + context?: unknown + ): OrderedSet; + filter( + predicate: (value: T, key: T, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new OrderedSet with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: T, key: T, iter: this) => value is F, + context?: C + ): [OrderedSet, OrderedSet]; + partition( + predicate: (this: C, value: T, key: T, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * Returns an OrderedSet of the same type "zipped" with the provided + * collections. + * + * Like `zipWith`, but using the default `zipper`: creating an `Array`. + * + * ```js + * const a = OrderedSet([ 1, 2, 3 ]) + * const b = OrderedSet([ 4, 5, 6 ]) + * const c = a.zip(b) + * // OrderedSet [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] + * ``` + */ + zip(other: Collection): OrderedSet<[T, U]>; + zip( + other1: Collection, + other2: Collection + ): OrderedSet<[T, U, V]>; + zip( + ...collections: Array> + ): OrderedSet; + + /** + * Returns a OrderedSet of the same type "zipped" with the provided + * collections. + * + * Unlike `zip`, `zipAll` continues zipping until the longest collection is + * exhausted. Missing values from shorter collections are filled with `undefined`. + * + * ```js + * const a = OrderedSet([ 1, 2 ]); + * const b = OrderedSet([ 3, 4, 5 ]); + * const c = a.zipAll(b); // OrderedSet [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ] + * ``` + * + * Note: Since zipAll will return a collection as large as the largest + * input, some results may contain undefined values. TypeScript cannot + * account for these without cases (as of v2.5). + */ + zipAll(other: Collection): OrderedSet<[T, U]>; + zipAll( + other1: Collection, + other2: Collection + ): OrderedSet<[T, U, V]>; + zipAll( + ...collections: Array> + ): OrderedSet; + + /** + * Returns an OrderedSet of the same type "zipped" with the provided + * collections by using a custom `zipper` function. + * + * @see Seq.Indexed.zipWith + */ + zipWith( + zipper: (value: T, otherValue: U) => Z, + otherCollection: Collection + ): OrderedSet; + zipWith( + zipper: (value: T, otherValue: U, thirdValue: V) => Z, + otherCollection: Collection, + thirdCollection: Collection + ): OrderedSet; + zipWith( + zipper: (...values: Array) => Z, + ...collections: Array> + ): OrderedSet; + } + + /** + * Stacks are indexed collections which support very efficient O(1) addition + * and removal from the front using `unshift(v)` and `shift()`. + * + * For familiarity, Stack also provides `push(v)`, `pop()`, and `peek()`, but + * be aware that they also operate on the front of the list, unlike List or + * a JavaScript Array. + * + * Note: `reverse()` or any inherent reverse traversal (`reduceRight`, + * `lastIndexOf`, etc.) is not efficient with a Stack. + * + * Stack is implemented with a Single-Linked List. + */ + namespace Stack { + /** + * True if the provided value is a Stack + */ + function isStack(maybeStack: unknown): maybeStack is Stack; + + /** + * Creates a new Stack containing `values`. + */ + function of(...values: Array): Stack; + } + + /** + * Create a new immutable Stack containing the values of the provided + * collection-like. + * + * The iteration order of the provided collection is preserved in the + * resulting `Stack`. + * + * Note: `Stack` is a factory function and not a class, and does not use the + * `new` keyword during construction. + */ + function Stack(collection?: Iterable | ArrayLike): Stack; + + interface Stack extends Collection.Indexed { + /** + * The number of items in this Stack. + */ + readonly size: number; + + // Reading values + + /** + * Alias for `Stack.first()`. + */ + peek(): T | undefined; + + // Persistent changes + + /** + * Returns a new Stack with 0 size and no values. + * + * Note: `clear` can be used in `withMutations`. + */ + clear(): Stack; + + /** + * Returns a new Stack with the provided `values` prepended, shifting other + * values ahead to higher indices. + * + * This is very efficient for Stack. + * + * Note: `unshift` can be used in `withMutations`. + */ + unshift(...values: Array): Stack; + + /** + * Like `Stack#unshift`, but accepts a collection rather than varargs. + * + * Note: `unshiftAll` can be used in `withMutations`. + */ + unshiftAll(iter: Iterable): Stack; + + /** + * Returns a new Stack with a size ones less than this Stack, excluding + * the first item in this Stack, shifting all other values to a lower index. + * + * Note: this differs from `Array#shift` because it returns a new + * Stack rather than the removed value. Use `first()` or `peek()` to get the + * first value in this Stack. + * + * Note: `shift` can be used in `withMutations`. + */ + shift(): Stack; + + /** + * Alias for `Stack#unshift` and is not equivalent to `List#push`. + */ + push(...values: Array): Stack; + + /** + * Alias for `Stack#unshiftAll`. + */ + pushAll(iter: Iterable): Stack; + + /** + * Alias for `Stack#shift` and is not equivalent to `List#pop`. + */ + pop(): Stack; + + // Transient changes + + /** + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Check the documentation for each method to see if it + * mentions being safe to use in `withMutations`. + * + * @see `Map#withMutations` + */ + withMutations(mutator: (mutable: this) => unknown): this; + + /** + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Check the documentation for each method to see if it + * mentions being safe to use in `withMutations`. + * + * @see `Map#asMutable` + */ + asMutable(): this; + + /** + * @see `Map#wasAltered` + */ + wasAltered(): boolean; + + /** + * @see `Map#asImmutable` + */ + asImmutable(): this; + + // Sequence algorithms + + /** + * Returns a new Stack with other collections concatenated to this one. + */ + concat(...valuesOrCollections: Array | C>): Stack; + + /** + * Returns a new Stack with values passed through a + * `mapper` function. + * + * Stack([ 1, 2 ]).map(x => 10 * x) + * // Stack [ 10, 20 ] + * + * Note: `map()` always returns a new instance, even if it produced the same + * value at every step. + */ + map( + mapper: (value: T, key: number, iter: this) => M, + context?: unknown + ): Stack; + + /** + * Flat-maps the Stack, returning a new Stack. + * + * Similar to `stack.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: number, iter: this) => Iterable, + context?: unknown + ): Stack; + + /** + * Returns a new Set with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, index: number, iter: this) => value is F, + context?: unknown + ): Set; + filter( + predicate: (value: T, index: number, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a Stack "zipped" with the provided collections. + * + * Like `zipWith`, but using the default `zipper`: creating an `Array`. + * + * ```js + * const a = Stack([ 1, 2, 3 ]); + * const b = Stack([ 4, 5, 6 ]); + * const c = a.zip(b); // Stack [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] + * ``` + */ + zip(other: Collection): Stack<[T, U]>; + zip( + other: Collection, + other2: Collection + ): Stack<[T, U, V]>; + zip(...collections: Array>): Stack; + + /** + * Returns a Stack "zipped" with the provided collections. + * + * Unlike `zip`, `zipAll` continues zipping until the longest collection is + * exhausted. Missing values from shorter collections are filled with `undefined`. + * + * ```js + * const a = Stack([ 1, 2 ]); + * const b = Stack([ 3, 4, 5 ]); + * const c = a.zipAll(b); // Stack [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ] + * ``` + * + * Note: Since zipAll will return a collection as large as the largest + * input, some results may contain undefined values. TypeScript cannot + * account for these without cases (as of v2.5). + */ + zipAll(other: Collection): Stack<[T, U]>; + zipAll( + other: Collection, + other2: Collection + ): Stack<[T, U, V]>; + zipAll(...collections: Array>): Stack; + + /** + * Returns a Stack "zipped" with the provided collections by using a + * custom `zipper` function. + * + * ```js + * const a = Stack([ 1, 2, 3 ]); + * const b = Stack([ 4, 5, 6 ]); + * const c = a.zipWith((a, b) => a + b, b); + * // Stack [ 5, 7, 9 ] + * ``` + */ + zipWith( + zipper: (value: T, otherValue: U) => Z, + otherCollection: Collection + ): Stack; + zipWith( + zipper: (value: T, otherValue: U, thirdValue: V) => Z, + otherCollection: Collection, + thirdCollection: Collection + ): Stack; + zipWith( + zipper: (...values: Array) => Z, + ...collections: Array> + ): Stack; + } + + /** + * Returns a Seq.Indexed of numbers from `start` (inclusive) to `end` + * (exclusive), by `step`, where `start` defaults to 0, `step` to 1, and `end` to + * infinity. When `start` is equal to `end`, returns empty range. + * + * Note: `Range` is a factory function and not a class, and does not use the + * `new` keyword during construction. + * + * ```js + * const { Range } = require('immutable') + * Range() // [ 0, 1, 2, 3, ... ] + * Range(10) // [ 10, 11, 12, 13, ... ] + * Range(10, 15) // [ 10, 11, 12, 13, 14 ] + * Range(10, 30, 5) // [ 10, 15, 20, 25 ] + * Range(30, 10, 5) // [ 30, 25, 20, 15 ] + * Range(30, 30, 5) // [] + * ``` + */ + function Range( + start: number, + end: number, + step?: number + ): Seq.Indexed; + + /** + * Returns a Seq.Indexed of `value` repeated `times` times. When `times` is + * not defined, returns an infinite `Seq` of `value`. + * + * Note: `Repeat` is a factory function and not a class, and does not use the + * `new` keyword during construction. + * + * ```js + * const { Repeat } = require('immutable') + * Repeat('foo') // [ 'foo', 'foo', 'foo', ... ] + * Repeat('bar', 4) // [ 'bar', 'bar', 'bar', 'bar' ] + * ``` + */ + function Repeat(value: T, times?: number): Seq.Indexed; + + /** + * A record is similar to a JS object, but enforces a specific set of allowed + * string keys, and has default values. + * + * The `Record()` function produces new Record Factories, which when called + * create Record instances. + * + * ```js + * const { Record } = require('immutable') + * const ABRecord = Record({ a: 1, b: 2 }) + * const myRecord = ABRecord({ b: 3 }) + * ``` + * + * Records always have a value for the keys they define. `remove`ing a key + * from a record simply resets it to the default value for that key. + * + * ```js + * myRecord.get('a') // 1 + * myRecord.get('b') // 3 + * const myRecordWithoutB = myRecord.remove('b') + * myRecordWithoutB.get('b') // 2 + * ``` + * + * Values provided to the constructor not found in the Record type will + * be ignored. For example, in this case, ABRecord is provided a key "x" even + * though only "a" and "b" have been defined. The value for "x" will be + * ignored for this record. + * + * ```js + * const myRecord = ABRecord({ b: 3, x: 10 }) + * myRecord.get('x') // undefined + * ``` + * + * Because Records have a known set of string keys, property get access works + * as expected, however property sets will throw an Error. + * + * Note: IE8 does not support property access. Only use `get()` when + * supporting IE8. + * + * ```js + * myRecord.b // 3 + * myRecord.b = 5 // throws Error + * ``` + * + * Record Types can be extended as well, allowing for custom methods on your + * Record. This is not a common pattern in functional environments, but is in + * many JS programs. + * + * However Record Types are more restricted than typical JavaScript classes. + * They do not use a class constructor, which also means they cannot use + * class properties (since those are technically part of a constructor). + * + * While Record Types can be syntactically created with the JavaScript `class` + * form, the resulting Record function is actually a factory function, not a + * class constructor. Even though Record Types are not classes, JavaScript + * currently requires the use of `new` when creating new Record instances if + * they are defined as a `class`. + * + * ``` + * class ABRecord extends Record({ a: 1, b: 2 }) { + * getAB() { + * return this.a + this.b; + * } + * } + * + * var myRecord = new ABRecord({b: 3}) + * myRecord.getAB() // 4 + * ``` + * + * + * **Flow Typing Records:** + * + * Immutable.js exports two Flow types designed to make it easier to use + * Records with flow typed code, `RecordOf` and `RecordFactory`. + * + * When defining a new kind of Record factory function, use a flow type that + * describes the values the record contains along with `RecordFactory`. + * To type instances of the Record (which the factory function returns), + * use `RecordOf`. + * + * Typically, new Record definitions will export both the Record factory + * function as well as the Record instance type for use in other code. + * + * ```js + * import type { RecordFactory, RecordOf } from 'immutable'; + * + * // Use RecordFactory for defining new Record factory functions. + * type Point3DProps = { x: number, y: number, z: number }; + * const defaultValues: Point3DProps = { x: 0, y: 0, z: 0 }; + * const makePoint3D: RecordFactory = Record(defaultValues); + * export makePoint3D; + * + * // Use RecordOf for defining new instances of that Record. + * export type Point3D = RecordOf; + * const some3DPoint: Point3D = makePoint3D({ x: 10, y: 20, z: 30 }); + * ``` + * + * **Flow Typing Record Subclasses:** + * + * Records can be subclassed as a means to add additional methods to Record + * instances. This is generally discouraged in favor of a more functional API, + * since Subclasses have some minor overhead. However the ability to create + * a rich API on Record types can be quite valuable. + * + * When using Flow to type Subclasses, do not use `RecordFactory`, + * instead apply the props type when subclassing: + * + * ```js + * type PersonProps = {name: string, age: number}; + * const defaultValues: PersonProps = {name: 'Aristotle', age: 2400}; + * const PersonRecord = Record(defaultValues); + * class Person extends PersonRecord { + * getName(): string { + * return this.get('name') + * } + * + * setName(name: string): this { + * return this.set('name', name); + * } + * } + * ``` + * + * **Choosing Records vs plain JavaScript objects** + * + * Records offer a persistently immutable alternative to plain JavaScript + * objects, however they're not required to be used within Immutable.js + * collections. In fact, the deep-access and deep-updating functions + * like `getIn()` and `setIn()` work with plain JavaScript Objects as well. + * + * Deciding to use Records or Objects in your application should be informed + * by the tradeoffs and relative benefits of each: + * + * - *Runtime immutability*: plain JS objects may be carefully treated as + * immutable, however Record instances will *throw* if attempted to be + * mutated directly. Records provide this additional guarantee, however at + * some marginal runtime cost. While JS objects are mutable by nature, the + * use of type-checking tools like [Flow](https://medium.com/@gcanti/immutability-with-flow-faa050a1aef4) + * can help gain confidence in code written to favor immutability. + * + * - *Value equality*: Records use value equality when compared with `is()` + * or `record.equals()`. That is, two Records with the same keys and values + * are equal. Plain objects use *reference equality*. Two objects with the + * same keys and values are not equal since they are different objects. + * This is important to consider when using objects as keys in a `Map` or + * values in a `Set`, which use equality when retrieving values. + * + * - *API methods*: Records have a full featured API, with methods like + * `.getIn()`, and `.equals()`. These can make working with these values + * easier, but comes at the cost of not allowing keys with those names. + * + * - *Default values*: Records provide default values for every key, which + * can be useful when constructing Records with often unchanging values. + * However default values can make using Flow and TypeScript more laborious. + * + * - *Serialization*: Records use a custom internal representation to + * efficiently store and update their values. Converting to and from this + * form isn't free. If converting Records to plain objects is common, + * consider sticking with plain objects to begin with. + */ + namespace Record { + /** + * True if `maybeRecord` is an instance of a Record. + */ + function isRecord(maybeRecord: unknown): maybeRecord is Record; + + /** + * Records allow passing a second parameter to supply a descriptive name + * that appears when converting a Record to a string or in any error + * messages. A descriptive name for any record can be accessed by using this + * method. If one was not provided, the string "Record" is returned. + * + * ```js + * const { Record } = require('immutable') + * const Person = Record({ + * name: null + * }, 'Person') + * + * var me = Person({ name: 'My Name' }) + * me.toString() // "Person { "name": "My Name" }" + * Record.getDescriptiveName(me) // "Person" + * ``` + */ + function getDescriptiveName( + record: RecordOf + ): string; + + /** + * A Record.Factory is created by the `Record()` function. Record instances + * are created by passing it some of the accepted values for that Record + * type: + * + * + * ```js + * // makePerson is a Record Factory function + * const makePerson = Record({ name: null, favoriteColor: 'unknown' }); + * + * // alan is a Record instance + * const alan = makePerson({ name: 'Alan' }); + * ``` + * + * Note that Record Factories return `Record & Readonly`, + * this allows use of both the Record instance API, and direct property + * access on the resulting instances: + * + * + * ```js + * // Use the Record API + * console.log('Record API: ' + alan.get('name')) + * + * // Or direct property access (Readonly) + * console.log('property access: ' + alan.name) + * ``` + * + * **Flow Typing Records:** + * + * Use the `RecordFactory` Flow type to get high quality type checking of + * Records: + * + * ```js + * import type { RecordFactory, RecordOf } from 'immutable'; + * + * // Use RecordFactory for defining new Record factory functions. + * type PersonProps = { name: ?string, favoriteColor: string }; + * const makePerson: RecordFactory = Record({ name: null, favoriteColor: 'unknown' }); + * + * // Use RecordOf for defining new instances of that Record. + * type Person = RecordOf; + * const alan: Person = makePerson({ name: 'Alan' }); + * ``` + */ + namespace Factory {} + + interface Factory { + ( + values?: Partial | Iterable<[string, unknown]> + ): RecordOf; + new ( + values?: Partial | Iterable<[string, unknown]> + ): RecordOf; + + /** + * The name provided to `Record(values, name)` can be accessed with + * `displayName`. + */ + displayName: string; + } + + function Factory( + values?: Partial | Iterable<[string, unknown]> + ): RecordOf; + } + + /** + * Unlike other types in Immutable.js, the `Record()` function creates a new + * Record Factory, which is a function that creates Record instances. + * + * See above for examples of using `Record()`. + * + * Note: `Record` is a factory function and not a class, and does not use the + * `new` keyword during construction. + */ + function Record( + defaultValues: TProps, + name?: string + ): Record.Factory; + + interface Record { + // Reading values + + has(key: string): key is keyof TProps & string; + + /** + * Returns the value associated with the provided key, which may be the + * default value defined when creating the Record factory function. + * + * If the requested key is not defined by this Record type, then + * notSetValue will be returned if provided. Note that this scenario would + * produce an error when using Flow or TypeScript. + */ + get(key: K, notSetValue?: unknown): TProps[K]; + get(key: string, notSetValue: T): T; + + // Reading deep values + + hasIn(keyPath: Iterable): boolean; + getIn(keyPath: Iterable): unknown; + + // Value equality + + equals(other: unknown): boolean; + hashCode(): number; + + // Persistent changes + + set(key: K, value: TProps[K]): this; + update( + key: K, + updater: (value: TProps[K]) => TProps[K] + ): this; + merge( + ...collections: Array | Iterable<[string, unknown]>> + ): this; + mergeDeep( + ...collections: Array | Iterable<[string, unknown]>> + ): this; + + mergeWith( + merger: (oldVal: unknown, newVal: unknown, key: keyof TProps) => unknown, + ...collections: Array | Iterable<[string, unknown]>> + ): this; + mergeDeepWith( + merger: (oldVal: unknown, newVal: unknown, key: unknown) => unknown, + ...collections: Array | Iterable<[string, unknown]>> + ): this; + + /** + * Returns a new instance of this Record type with the value for the + * specific key set to its default value. + * + * @alias remove + */ + delete(key: K): this; + remove(key: K): this; + + /** + * Returns a new instance of this Record type with all values set + * to their default values. + */ + clear(): this; + + // Deep persistent changes + + setIn(keyPath: Iterable, value: unknown): this; + updateIn( + keyPath: Iterable, + updater: (value: unknown) => unknown + ): this; + mergeIn(keyPath: Iterable, ...collections: Array): this; + mergeDeepIn( + keyPath: Iterable, + ...collections: Array + ): this; + + /** + * @alias removeIn + */ + deleteIn(keyPath: Iterable): this; + removeIn(keyPath: Iterable): this; + + // Conversion to JavaScript types + + /** + * Deeply converts this Record to equivalent native JavaScript Object. + * + * Note: This method may not be overridden. Objects with custom + * serialization to plain JS may override toJSON() instead. + */ + toJS(): DeepCopy; + + /** + * Shallowly converts this Record to equivalent native JavaScript Object. + */ + toJSON(): TProps; + + /** + * Shallowly converts this Record to equivalent JavaScript Object. + */ + toObject(): TProps; + + // Transient changes + + /** + * Note: Not all methods can be used on a mutable collection or within + * `withMutations`! Only `set` may be used mutatively. + * + * @see `Map#withMutations` + */ + withMutations(mutator: (mutable: this) => unknown): this; + + /** + * @see `Map#asMutable` + */ + asMutable(): this; + + /** + * @see `Map#wasAltered` + */ + wasAltered(): boolean; + + /** + * @see `Map#asImmutable` + */ + asImmutable(): this; + + // Sequence algorithms + + toSeq(): Seq.Keyed; + + [Symbol.iterator](): IterableIterator<[keyof TProps, TProps[keyof TProps]]>; + } + + /** + * RecordOf is used in TypeScript to define interfaces expecting an + * instance of record with type T. + * + * This is equivalent to an instance of a record created by a Record Factory. + */ + type RecordOf = Record & Readonly; + + /** + * `Seq` describes a lazy operation, allowing them to efficiently chain + * use of all the higher-order collection methods (such as `map` and `filter`) + * by not creating intermediate collections. + * + * **Seq is immutable** — Once a Seq is created, it cannot be + * changed, appended to, rearranged or otherwise modified. Instead, any + * mutative method called on a `Seq` will return a new `Seq`. + * + * **Seq is lazy** — `Seq` does as little work as necessary to respond to any + * method call. Values are often created during iteration, including implicit + * iteration when reducing or converting to a concrete data structure such as + * a `List` or JavaScript `Array`. + * + * For example, the following performs no work, because the resulting + * `Seq`'s values are never iterated: + * + * ```js + * const { Seq } = require('immutable') + * const oddSquares = Seq([ 1, 2, 3, 4, 5, 6, 7, 8 ]) + * .filter(x => x % 2 !== 0) + * .map(x => x * x) + * ``` + * + * Once the `Seq` is used, it performs only the work necessary. In this + * example, no intermediate arrays are ever created, filter is called three + * times, and map is only called once: + * + * ```js + * oddSquares.get(1); // 9 + * ``` + * + * Any collection can be converted to a lazy Seq with `Seq()`. + * + * + * ```js + * const { Map } = require('immutable') + * const map = Map({ a: 1, b: 2, c: 3 }) + * const lazySeq = Seq(map) + * ``` + * + * `Seq` allows for the efficient chaining of operations, allowing for the + * expression of logic that can otherwise be very tedious: + * + * ```js + * lazySeq + * .flip() + * .map(key => key.toUpperCase()) + * .flip() + * // Seq { A: 1, B: 1, C: 1 } + * ``` + * + * As well as expressing logic that would otherwise seem memory or time + * limited, for example `Range` is a special kind of Lazy sequence. + * + * + * ```js + * const { Range } = require('immutable') + * Range(1, Infinity) + * .skip(1000) + * .map(n => -n) + * .filter(n => n % 2 === 0) + * .take(2) + * .reduce((r, n) => r * n, 1) + * // 1006008 + * ``` + * + * Seq is often used to provide a rich collection API to JavaScript Object. + * + * ```js + * Seq({ x: 0, y: 1, z: 2 }).map(v => v * 2).toObject(); + * // { x: 0, y: 2, z: 4 } + * ``` + */ + + namespace Seq { + /** + * True if `maybeSeq` is a Seq, it is not backed by a concrete + * structure such as Map, List, or Set. + */ + function isSeq( + maybeSeq: unknown + ): maybeSeq is + | Seq.Indexed + | Seq.Keyed + | Seq.Set; + + /** + * `Seq` which represents key-value pairs. + */ + namespace Keyed {} + + /** + * Always returns a Seq.Keyed, if input is not keyed, expects an + * collection of [K, V] tuples. + * + * Note: `Seq.Keyed` is a conversion function and not a class, and does not + * use the `new` keyword during construction. + */ + function Keyed(collection?: Iterable<[K, V]>): Seq.Keyed; + function Keyed(obj: { [key: string]: V }): Seq.Keyed; + + interface Keyed extends Seq, Collection.Keyed { + /** + * Deeply converts this Keyed Seq to equivalent native JavaScript Object. + * + * Converts keys to Strings. + */ + toJS(): { [key in PropertyKey]: DeepCopy }; + + /** + * Shallowly converts this Keyed Seq to equivalent native JavaScript Object. + * + * Converts keys to Strings. + */ + toJSON(): { [key in PropertyKey]: V }; + + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array<[K, V]>; + + /** + * Returns itself + */ + toSeq(): this; + + /** + * Returns a new Seq with other collections concatenated to this one. + * + * All entries will be present in the resulting Seq, even if they + * have the same key. + */ + concat( + ...collections: Array> + ): Seq.Keyed; + concat( + ...collections: Array<{ [key: string]: C }> + ): Seq.Keyed; + + /** + * Returns a new Seq.Keyed with values passed through a + * `mapper` function. + * + * ```js + * const { Seq } = require('immutable') + * Seq.Keyed({ a: 1, b: 2 }).map(x => 10 * x) + * // Seq { "a": 10, "b": 20 } + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the + * same value at every step. + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): Seq.Keyed; + + /** + * @see Collection.Keyed.mapKeys + */ + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: unknown + ): Seq.Keyed; + + /** + * @see Collection.Keyed.mapEntries + */ + mapEntries( + mapper: ( + entry: [K, V], + index: number, + iter: this + ) => [KM, VM] | undefined, + context?: unknown + ): Seq.Keyed; + + /** + * Flat-maps the Seq, returning a Seq of the same type. + * + * Similar to `seq.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: unknown + ): Seq.Keyed; + + /** + * Returns a new Seq with only the entries for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: V, key: K, iter: this) => value is F, + context?: unknown + ): Seq.Keyed; + filter( + predicate: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new keyed Seq with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: V, key: K, iter: this) => value is F, + context?: C + ): [Seq.Keyed, Seq.Keyed]; + partition( + predicate: (this: C, value: V, key: K, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * @see Collection.Keyed.flip + */ + flip(): Seq.Keyed; + + [Symbol.iterator](): IterableIterator<[K, V]>; + } + + /** + * `Seq` which represents an ordered indexed list of values. + */ + namespace Indexed { + /** + * Provides an Seq.Indexed of the values provided. + */ + function of(...values: Array): Seq.Indexed; + } + + /** + * Always returns Seq.Indexed, discarding associated keys and + * supplying incrementing indices. + * + * Note: `Seq.Indexed` is a conversion function and not a class, and does + * not use the `new` keyword during construction. + */ + function Indexed( + collection?: Iterable | ArrayLike + ): Seq.Indexed; + + interface Indexed extends Seq, Collection.Indexed { + /** + * Deeply converts this Indexed Seq to equivalent native JavaScript Array. + */ + toJS(): Array>; + + /** + * Shallowly converts this Indexed Seq to equivalent native JavaScript Array. + */ + toJSON(): Array; + + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array; + + /** + * Returns itself + */ + toSeq(): this; + + /** + * Returns a new Seq with other collections concatenated to this one. + */ + concat( + ...valuesOrCollections: Array | C> + ): Seq.Indexed; + + /** + * Returns a new Seq.Indexed with values passed through a + * `mapper` function. + * + * ```js + * const { Seq } = require('immutable') + * Seq.Indexed([ 1, 2 ]).map(x => 10 * x) + * // Seq [ 10, 20 ] + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the + * same value at every step. + */ + map( + mapper: (value: T, key: number, iter: this) => M, + context?: unknown + ): Seq.Indexed; + + /** + * Flat-maps the Seq, returning a a Seq of the same type. + * + * Similar to `seq.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: number, iter: this) => Iterable, + context?: unknown + ): Seq.Indexed; + + /** + * Returns a new Seq with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, index: number, iter: this) => value is F, + context?: unknown + ): Seq.Indexed; + filter( + predicate: (value: T, index: number, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new indexed Seq with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: T, index: number, iter: this) => value is F, + context?: C + ): [Seq.Indexed, Seq.Indexed]; + partition( + predicate: (this: C, value: T, index: number, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * Returns a Seq "zipped" with the provided collections. + * + * Like `zipWith`, but using the default `zipper`: creating an `Array`. + * + * ```js + * const a = Seq([ 1, 2, 3 ]); + * const b = Seq([ 4, 5, 6 ]); + * const c = a.zip(b); // Seq [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] + * ``` + */ + zip(other: Collection): Seq.Indexed<[T, U]>; + zip( + other: Collection, + other2: Collection + ): Seq.Indexed<[T, U, V]>; + zip( + ...collections: Array> + ): Seq.Indexed; + + /** + * Returns a Seq "zipped" with the provided collections. + * + * Unlike `zip`, `zipAll` continues zipping until the longest collection is + * exhausted. Missing values from shorter collections are filled with `undefined`. + * + * ```js + * const a = Seq([ 1, 2 ]); + * const b = Seq([ 3, 4, 5 ]); + * const c = a.zipAll(b); // Seq [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ] + * ``` + */ + zipAll(other: Collection): Seq.Indexed<[T, U]>; + zipAll( + other: Collection, + other2: Collection + ): Seq.Indexed<[T, U, V]>; + zipAll( + ...collections: Array> + ): Seq.Indexed; + + /** + * Returns a Seq "zipped" with the provided collections by using a + * custom `zipper` function. + * + * ```js + * const a = Seq([ 1, 2, 3 ]); + * const b = Seq([ 4, 5, 6 ]); + * const c = a.zipWith((a, b) => a + b, b); + * // Seq [ 5, 7, 9 ] + * ``` + */ + zipWith( + zipper: (value: T, otherValue: U) => Z, + otherCollection: Collection + ): Seq.Indexed; + zipWith( + zipper: (value: T, otherValue: U, thirdValue: V) => Z, + otherCollection: Collection, + thirdCollection: Collection + ): Seq.Indexed; + zipWith( + zipper: (...values: Array) => Z, + ...collections: Array> + ): Seq.Indexed; + + [Symbol.iterator](): IterableIterator; + } + + /** + * `Seq` which represents a set of values. + * + * Because `Seq` are often lazy, `Seq.Set` does not provide the same guarantee + * of value uniqueness as the concrete `Set`. + */ + namespace Set { + /** + * Returns a Seq.Set of the provided values + */ + function of(...values: Array): Seq.Set; + } + + /** + * Always returns a Seq.Set, discarding associated indices or keys. + * + * Note: `Seq.Set` is a conversion function and not a class, and does not + * use the `new` keyword during construction. + */ + function Set(collection?: Iterable | ArrayLike): Seq.Set; + + interface Set extends Seq, Collection.Set { + /** + * Deeply converts this Set Seq to equivalent native JavaScript Array. + */ + toJS(): Array>; + + /** + * Shallowly converts this Set Seq to equivalent native JavaScript Array. + */ + toJSON(): Array; + + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array; + + /** + * Returns itself + */ + toSeq(): this; + + /** + * Returns a new Seq with other collections concatenated to this one. + * + * All entries will be present in the resulting Seq, even if they + * are duplicates. + */ + concat(...collections: Array>): Seq.Set; + + /** + * Returns a new Seq.Set with values passed through a + * `mapper` function. + * + * ```js + * Seq.Set([ 1, 2 ]).map(x => 10 * x) + * // Seq { 10, 20 } + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the + * same value at every step. + */ + map( + mapper: (value: T, key: T, iter: this) => M, + context?: unknown + ): Seq.Set; + + /** + * Flat-maps the Seq, returning a Seq of the same type. + * + * Similar to `seq.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: T, iter: this) => Iterable, + context?: unknown + ): Seq.Set; + + /** + * Returns a new Seq with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, key: T, iter: this) => value is F, + context?: unknown + ): Seq.Set; + filter( + predicate: (value: T, key: T, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new set Seq with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: T, key: T, iter: this) => value is F, + context?: C + ): [Seq.Set, Seq.Set]; + partition( + predicate: (this: C, value: T, key: T, iter: this) => unknown, + context?: C + ): [this, this]; + + [Symbol.iterator](): IterableIterator; + } + } + + /** + * Creates a Seq. + * + * Returns a particular kind of `Seq` based on the input. + * + * * If a `Seq`, that same `Seq`. + * * If an `Collection`, a `Seq` of the same kind (Keyed, Indexed, or Set). + * * If an Array-like, an `Seq.Indexed`. + * * If an Iterable Object, an `Seq.Indexed`. + * * If an Object, a `Seq.Keyed`. + * + * Note: An Iterator itself will be treated as an object, becoming a `Seq.Keyed`, + * which is usually not what you want. You should turn your Iterator Object into + * an iterable object by defining a Symbol.iterator (or @@iterator) method which + * returns `this`. + * + * Note: `Seq` is a conversion function and not a class, and does not use the + * `new` keyword during construction. + */ + function Seq>(seq: S): S; + function Seq(collection: Collection.Keyed): Seq.Keyed; + function Seq(collection: Collection.Set): Seq.Set; + function Seq( + collection: Collection.Indexed | Iterable | ArrayLike + ): Seq.Indexed; + function Seq(obj: { [key: string]: V }): Seq.Keyed; + function Seq(): Seq; + + interface Seq extends Collection { + /** + * Some Seqs can describe their size lazily. When this is the case, + * size will be an integer. Otherwise it will be undefined. + * + * For example, Seqs returned from `map()` or `reverse()` + * preserve the size of the original `Seq` while `filter()` does not. + * + * Note: `Range`, `Repeat` and `Seq`s made from `Array`s and `Object`s will + * always have a size. + */ + readonly size: number | undefined; + + // Force evaluation + + /** + * Because Sequences are lazy and designed to be chained together, they do + * not cache their results. For example, this map function is called a total + * of 6 times, as each `join` iterates the Seq of three values. + * + * var squares = Seq([ 1, 2, 3 ]).map(x => x * x) + * squares.join() + squares.join() + * + * If you know a `Seq` will be used multiple times, it may be more + * efficient to first cache it in memory. Here, the map function is called + * only 3 times. + * + * var squares = Seq([ 1, 2, 3 ]).map(x => x * x).cacheResult() + * squares.join() + squares.join() + * + * Use this method judiciously, as it must fully evaluate a Seq which can be + * a burden on memory and possibly performance. + * + * Note: after calling `cacheResult`, a Seq will always have a `size`. + */ + cacheResult(): this; + + // Sequence algorithms + + /** + * Returns a new Seq with values passed through a + * `mapper` function. + * + * ```js + * const { Seq } = require('immutable') + * Seq([ 1, 2 ]).map(x => 10 * x) + * // Seq [ 10, 20 ] + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the same + * value at every step. + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): Seq; + + /** + * Returns a new Seq with values passed through a + * `mapper` function. + * + * ```js + * const { Seq } = require('immutable') + * Seq([ 1, 2 ]).map(x => 10 * x) + * // Seq [ 10, 20 ] + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the same + * value at every step. + * Note: used only for sets. + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): Seq; + + /** + * Flat-maps the Seq, returning a Seq of the same type. + * + * Similar to `seq.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable, + context?: unknown + ): Seq; + + /** + * Flat-maps the Seq, returning a Seq of the same type. + * + * Similar to `seq.map(...).flatten(true)`. + * Note: Used only for sets. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable, + context?: unknown + ): Seq; + + /** + * Returns a new Seq with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: V, key: K, iter: this) => value is F, + context?: unknown + ): Seq; + filter( + predicate: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new Seq with the values for which the `predicate` function + * returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: V, key: K, iter: this) => value is F, + context?: C + ): [Seq, Seq]; + partition( + predicate: (this: C, value: V, key: K, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * Returns a new Sequence of the same type with other values and + * collection-like concatenated to this one. + * + * All entries will be present in the resulting Seq, even if they + * have the same key. + */ + concat(...valuesOrCollections: Array): Seq; + } + + /** + * The `Collection` is a set of (key, value) entries which can be iterated, and + * is the base class for all collections in `immutable`, allowing them to + * make use of all the Collection methods (such as `map` and `filter`). + * + * Note: A collection is always iterated in the same order, however that order + * may not always be well defined, as is the case for the `Map` and `Set`. + * + * Collection is the abstract base class for concrete data structures. It + * cannot be constructed directly. + * + * Implementations should extend one of the subclasses, `Collection.Keyed`, + * `Collection.Indexed`, or `Collection.Set`. + */ + namespace Collection { + /** + * Keyed Collections have discrete keys tied to each value. + * + * When iterating `Collection.Keyed`, each iteration will yield a `[K, V]` + * tuple, in other words, `Collection#entries` is the default iterator for + * Keyed Collections. + */ + namespace Keyed {} + + /** + * Creates a Collection.Keyed + * + * Similar to `Collection()`, however it expects collection-likes of [K, V] + * tuples if not constructed from a Collection.Keyed or JS Object. + * + * Note: `Collection.Keyed` is a conversion function and not a class, and + * does not use the `new` keyword during construction. + */ + function Keyed(collection?: Iterable<[K, V]>): Collection.Keyed; + function Keyed(obj: { [key: string]: V }): Collection.Keyed; + + interface Keyed extends Collection { + /** + * Deeply converts this Keyed collection to equivalent native JavaScript Object. + * + * Converts keys to Strings. + */ + toJS(): { [key in PropertyKey]: DeepCopy }; + + /** + * Shallowly converts this Keyed collection to equivalent native JavaScript Object. + * + * Converts keys to Strings. + */ + toJSON(): { [key in PropertyKey]: V }; + + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array<[K, V]>; + + /** + * Returns Seq.Keyed. + * @override + */ + toSeq(): Seq.Keyed; + + // Sequence functions + + /** + * Returns a new Collection.Keyed of the same type where the keys and values + * have been flipped. + * + * + * ```js + * const { Map } = require('immutable') + * Map({ a: 'z', b: 'y' }).flip() + * // Map { "z": "a", "y": "b" } + * ``` + */ + flip(): Collection.Keyed; + + /** + * Returns a new Collection with other collections concatenated to this one. + */ + concat( + ...collections: Array> + ): Collection.Keyed; + concat( + ...collections: Array<{ [key: string]: C }> + ): Collection.Keyed; + + /** + * Returns a new Collection.Keyed with values passed through a + * `mapper` function. + * + * ```js + * const { Collection } = require('immutable') + * Collection.Keyed({ a: 1, b: 2 }).map(x => 10 * x) + * // Seq { "a": 10, "b": 20 } + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the + * same value at every step. + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): Collection.Keyed; + + /** + * Returns a new Collection.Keyed of the same type with keys passed through + * a `mapper` function. + * + * + * ```js + * const { Map } = require('immutable') + * Map({ a: 1, b: 2 }).mapKeys(x => x.toUpperCase()) + * // Map { "A": 1, "B": 2 } + * ``` + * + * Note: `mapKeys()` always returns a new instance, even if it produced + * the same key at every step. + */ + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: unknown + ): Collection.Keyed; + + /** + * Returns a new Collection.Keyed of the same type with entries + * ([key, value] tuples) passed through a `mapper` function. + * + * + * ```js + * const { Map } = require('immutable') + * Map({ a: 1, b: 2 }) + * .mapEntries(([ k, v ]) => [ k.toUpperCase(), v * 2 ]) + * // Map { "A": 2, "B": 4 } + * ``` + * + * Note: `mapEntries()` always returns a new instance, even if it produced + * the same entry at every step. + * + * If the mapper function returns `undefined`, then the entry will be filtered + */ + mapEntries( + mapper: ( + entry: [K, V], + index: number, + iter: this + ) => [KM, VM] | undefined, + context?: unknown + ): Collection.Keyed; + + /** + * Flat-maps the Collection, returning a Collection of the same type. + * + * Similar to `collection.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: unknown + ): Collection.Keyed; + + /** + * Returns a new Collection with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: V, key: K, iter: this) => value is F, + context?: unknown + ): Collection.Keyed; + filter( + predicate: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new keyed Collection with the values for which the + * `predicate` function returns false and another for which is returns + * true. + */ + partition( + predicate: (this: C, value: V, key: K, iter: this) => value is F, + context?: C + ): [Collection.Keyed, Collection.Keyed]; + partition( + predicate: (this: C, value: V, key: K, iter: this) => unknown, + context?: C + ): [this, this]; + + [Symbol.iterator](): IterableIterator<[K, V]>; + } + + /** + * Indexed Collections have incrementing numeric keys. They exhibit + * slightly different behavior than `Collection.Keyed` for some methods in order + * to better mirror the behavior of JavaScript's `Array`, and add methods + * which do not make sense on non-indexed Collections such as `indexOf`. + * + * Unlike JavaScript arrays, `Collection.Indexed`s are always dense. "Unset" + * indices and `undefined` indices are indistinguishable, and all indices from + * 0 to `size` are visited when iterated. + * + * All Collection.Indexed methods return re-indexed Collections. In other words, + * indices always start at 0 and increment until size. If you wish to + * preserve indices, using them as keys, convert to a Collection.Keyed by + * calling `toKeyedSeq`. + */ + namespace Indexed {} + + /** + * Creates a new Collection.Indexed. + * + * Note: `Collection.Indexed` is a conversion function and not a class, and + * does not use the `new` keyword during construction. + */ + function Indexed( + collection?: Iterable | ArrayLike + ): Collection.Indexed; + + interface Indexed extends Collection, OrderedCollection { + /** + * Deeply converts this Indexed collection to equivalent native JavaScript Array. + */ + toJS(): Array>; + + /** + * Shallowly converts this Indexed collection to equivalent native JavaScript Array. + */ + toJSON(): Array; + + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array; + + // Reading values + + /** + * Returns the value associated with the provided index, or notSetValue if + * the index is beyond the bounds of the Collection. + * + * `index` may be a negative number, which indexes back from the end of the + * Collection. `s.get(-1)` gets the last item in the Collection. + */ + get(index: number, notSetValue: NSV): T | NSV; + get(index: number): T | undefined; + + // Conversion to Seq + + /** + * Returns Seq.Indexed. + * @override + */ + toSeq(): Seq.Indexed; + + /** + * If this is a collection of [key, value] entry tuples, it will return a + * Seq.Keyed of those entries. + */ + fromEntrySeq(): Seq.Keyed; + + // Combination + + /** + * Returns a Collection of the same type with `separator` between each item + * in this Collection. + */ + interpose(separator: T): this; + + /** + * Returns a Collection of the same type with the provided `collections` + * interleaved into this collection. + * + * The resulting Collection includes the first item from each, then the + * second from each, etc. + * + * + * ```js + * const { List } = require('immutable') + * List([ 1, 2, 3 ]).interleave(List([ 'A', 'B', 'C' ])) + * // List [ 1, "A", 2, "B", 3, "C" ] + * ``` + * + * The shortest Collection stops interleave. + * + * + * ```js + * List([ 1, 2, 3 ]).interleave( + * List([ 'A', 'B' ]), + * List([ 'X', 'Y', 'Z' ]) + * ) + * // List [ 1, "A", "X", 2, "B", "Y" ] + * ``` + * + * Since `interleave()` re-indexes values, it produces a complete copy, + * which has `O(N)` complexity. + * + * Note: `interleave` *cannot* be used in `withMutations`. + */ + interleave(...collections: Array>): this; + + /** + * Splice returns a new indexed Collection by replacing a region of this + * Collection with new values. If values are not provided, it only skips the + * region to be removed. + * + * `index` may be a negative number, which indexes back from the end of the + * Collection. `s.splice(-2)` splices after the second to last item. + * + * + * ```js + * const { List } = require('immutable') + * List([ 'a', 'b', 'c', 'd' ]).splice(1, 2, 'q', 'r', 's') + * // List [ "a", "q", "r", "s", "d" ] + * ``` + * + * Since `splice()` re-indexes values, it produces a complete copy, which + * has `O(N)` complexity. + * + * Note: `splice` *cannot* be used in `withMutations`. + */ + splice(index: number, removeNum: number, ...values: Array): this; + + /** + * Returns a Collection of the same type "zipped" with the provided + * collections. + * + * Like `zipWith`, but using the default `zipper`: creating an `Array`. + * + * + * + * ```js + * const a = List([ 1, 2, 3 ]); + * const b = List([ 4, 5, 6 ]); + * const c = a.zip(b); // List [ [ 1, 4 ], [ 2, 5 ], [ 3, 6 ] ] + * ``` + */ + zip(other: Collection): Collection.Indexed<[T, U]>; + zip( + other: Collection, + other2: Collection + ): Collection.Indexed<[T, U, V]>; + zip( + ...collections: Array> + ): Collection.Indexed; + + /** + * Returns a Collection "zipped" with the provided collections. + * + * Unlike `zip`, `zipAll` continues zipping until the longest collection is + * exhausted. Missing values from shorter collections are filled with `undefined`. + * + * ```js + * const a = List([ 1, 2 ]); + * const b = List([ 3, 4, 5 ]); + * const c = a.zipAll(b); // List [ [ 1, 3 ], [ 2, 4 ], [ undefined, 5 ] ] + * ``` + */ + zipAll(other: Collection): Collection.Indexed<[T, U]>; + zipAll( + other: Collection, + other2: Collection + ): Collection.Indexed<[T, U, V]>; + zipAll( + ...collections: Array> + ): Collection.Indexed; + + /** + * Returns a Collection of the same type "zipped" with the provided + * collections by using a custom `zipper` function. + * + * + * ```js + * const a = List([ 1, 2, 3 ]); + * const b = List([ 4, 5, 6 ]); + * const c = a.zipWith((a, b) => a + b, b); + * // List [ 5, 7, 9 ] + * ``` + */ + zipWith( + zipper: (value: T, otherValue: U) => Z, + otherCollection: Collection + ): Collection.Indexed; + zipWith( + zipper: (value: T, otherValue: U, thirdValue: V) => Z, + otherCollection: Collection, + thirdCollection: Collection + ): Collection.Indexed; + zipWith( + zipper: (...values: Array) => Z, + ...collections: Array> + ): Collection.Indexed; + + // Search for value + + /** + * Returns the first index at which a given value can be found in the + * Collection, or -1 if it is not present. + */ + indexOf(searchValue: T): number; + + /** + * Returns the last index at which a given value can be found in the + * Collection, or -1 if it is not present. + */ + lastIndexOf(searchValue: T): number; + + /** + * Returns the first index in the Collection where a value satisfies the + * provided predicate function. Otherwise -1 is returned. + */ + findIndex( + predicate: (value: T, index: number, iter: this) => boolean, + context?: unknown + ): number; + + /** + * Returns the last index in the Collection where a value satisfies the + * provided predicate function. Otherwise -1 is returned. + */ + findLastIndex( + predicate: (value: T, index: number, iter: this) => boolean, + context?: unknown + ): number; + + // Sequence algorithms + + /** + * Returns a new Collection with other collections concatenated to this one. + */ + concat( + ...valuesOrCollections: Array | C> + ): Collection.Indexed; + + /** + * Returns a new Collection.Indexed with values passed through a + * `mapper` function. + * + * ```js + * const { Collection } = require('immutable') + * Collection.Indexed([1,2]).map(x => 10 * x) + * // Seq [ 1, 2 ] + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the + * same value at every step. + */ + map( + mapper: (value: T, key: number, iter: this) => M, + context?: unknown + ): Collection.Indexed; + + /** + * Flat-maps the Collection, returning a Collection of the same type. + * + * Similar to `collection.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: number, iter: this) => Iterable, + context?: unknown + ): Collection.Indexed; + + /** + * Returns a new Collection with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, index: number, iter: this) => value is F, + context?: unknown + ): Collection.Indexed; + filter( + predicate: (value: T, index: number, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new indexed Collection with the values for which the + * `predicate` function returns false and another for which is returns + * true. + */ + partition( + predicate: (this: C, value: T, index: number, iter: this) => value is F, + context?: C + ): [Collection.Indexed, Collection.Indexed]; + partition( + predicate: (this: C, value: T, index: number, iter: this) => unknown, + context?: C + ): [this, this]; + + [Symbol.iterator](): IterableIterator; + } + + /** + * Set Collections only represent values. They have no associated keys or + * indices. Duplicate values are possible in the lazy `Seq.Set`s, however + * the concrete `Set` Collection does not allow duplicate values. + * + * Collection methods on Collection.Set such as `map` and `forEach` will provide + * the value as both the first and second arguments to the provided function. + * + * ```js + * const { Collection } = require('immutable') + * const seq = Collection.Set([ 'A', 'B', 'C' ]) + * // Seq { "A", "B", "C" } + * seq.forEach((v, k) => + * assert.equal(v, k) + * ) + * ``` + */ + namespace Set {} + + /** + * Similar to `Collection()`, but always returns a Collection.Set. + * + * Note: `Collection.Set` is a factory function and not a class, and does + * not use the `new` keyword during construction. + */ + function Set(collection?: Iterable | ArrayLike): Collection.Set; + + interface Set extends Collection { + /** + * Deeply converts this Set collection to equivalent native JavaScript Array. + */ + toJS(): Array>; + + /** + * Shallowly converts this Set collection to equivalent native JavaScript Array. + */ + toJSON(): Array; + + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array; + + /** + * Returns Seq.Set. + * @override + */ + toSeq(): Seq.Set; + + // Sequence algorithms + + /** + * Returns a new Collection with other collections concatenated to this one. + */ + concat(...collections: Array>): Collection.Set; + + /** + * Returns a new Collection.Set with values passed through a + * `mapper` function. + * + * ``` + * Collection.Set([ 1, 2 ]).map(x => 10 * x) + * // Seq { 1, 2 } + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the + * same value at every step. + */ + map( + mapper: (value: T, key: T, iter: this) => M, + context?: unknown + ): Collection.Set; + + /** + * Flat-maps the Collection, returning a Collection of the same type. + * + * Similar to `collection.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: T, key: T, iter: this) => Iterable, + context?: unknown + ): Collection.Set; + + /** + * Returns a new Collection with only the values for which the `predicate` + * function returns true. + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: T, key: T, iter: this) => value is F, + context?: unknown + ): Collection.Set; + filter( + predicate: (value: T, key: T, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new set Collection with the values for which the + * `predicate` function returns false and another for which is returns + * true. + */ + partition( + predicate: (this: C, value: T, key: T, iter: this) => value is F, + context?: C + ): [Collection.Set, Collection.Set]; + partition( + predicate: (this: C, value: T, key: T, iter: this) => unknown, + context?: C + ): [this, this]; + + [Symbol.iterator](): IterableIterator; + } + } + + /** + * Creates a Collection. + * + * The type of Collection created is based on the input. + * + * * If an `Collection`, that same `Collection`. + * * If an Array-like, an `Collection.Indexed`. + * * If an Object with an Iterator defined, an `Collection.Indexed`. + * * If an Object, an `Collection.Keyed`. + * + * This methods forces the conversion of Objects and Strings to Collections. + * If you want to ensure that a Collection of one item is returned, use + * `Seq.of`. + * + * Note: An Iterator itself will be treated as an object, becoming a `Seq.Keyed`, + * which is usually not what you want. You should turn your Iterator Object into + * an iterable object by defining a Symbol.iterator (or @@iterator) method which + * returns `this`. + * + * Note: `Collection` is a conversion function and not a class, and does not + * use the `new` keyword during construction. + */ + function Collection>(collection: I): I; + function Collection( + collection: Iterable | ArrayLike + ): Collection.Indexed; + function Collection(obj: { + [key: string]: V; + }): Collection.Keyed; + function Collection(): Collection; + + interface Collection extends ValueObject { + // Value equality + + /** + * True if this and the other Collection have value equality, as defined + * by `Immutable.is()`. + * + * Note: This is equivalent to `Immutable.is(this, other)`, but provided to + * allow for chained expressions. + */ + equals(other: unknown): boolean; + + /** + * Computes and returns the hashed identity for this Collection. + * + * The `hashCode` of a Collection is used to determine potential equality, + * and is used when adding this to a `Set` or as a key in a `Map`, enabling + * lookup via a different instance. + * + * + * ```js + * const a = List([ 1, 2, 3 ]); + * const b = List([ 1, 2, 3 ]); + * assert.notStrictEqual(a, b); // different instances + * const set = Set([ a ]); + * assert.equal(set.has(b), true); + * ``` + * + * If two values have the same `hashCode`, they are [not guaranteed + * to be equal][Hash Collision]. If two values have different `hashCode`s, + * they must not be equal. + * + * [Hash Collision]: https://en.wikipedia.org/wiki/Collision_(computer_science) + */ + hashCode(): number; + + // Reading values + + /** + * Returns the value associated with the provided key, or notSetValue if + * the Collection does not contain this key. + * + * Note: it is possible a key may be associated with an `undefined` value, + * so if `notSetValue` is not provided and this method returns `undefined`, + * that does not guarantee the key was not found. + */ + get(key: K, notSetValue: NSV): V | NSV; + get(key: K): V | undefined; + + /** + * True if a key exists within this `Collection`, using `Immutable.is` + * to determine equality + */ + has(key: K): boolean; + + /** + * True if a value exists within this `Collection`, using `Immutable.is` + * to determine equality + * @alias contains + */ + includes(value: V): boolean; + contains(value: V): boolean; + + /** + * In case the `Collection` is not empty returns the first element of the + * `Collection`. + * In case the `Collection` is empty returns the optional default + * value if provided, if no default value is provided returns undefined. + */ + first(notSetValue: NSV): V | NSV; + first(): V | undefined; + + /** + * In case the `Collection` is not empty returns the last element of the + * `Collection`. + * In case the `Collection` is empty returns the optional default + * value if provided, if no default value is provided returns undefined. + */ + last(notSetValue: NSV): V | NSV; + last(): V | undefined; + + // Reading deep values + + /** + * Returns the value found by following a path of keys or indices through + * nested Collections. + * + * + * ```js + * const { Map, List } = require('immutable') + * const deepData = Map({ x: List([ Map({ y: 123 }) ]) }); + * deepData.getIn(['x', 0, 'y']) // 123 + * ``` + * + * Plain JavaScript Object or Arrays may be nested within an Immutable.js + * Collection, and getIn() can access those values as well: + * + * + * ```js + * const { Map, List } = require('immutable') + * const deepData = Map({ x: [ { y: 123 } ] }); + * deepData.getIn(['x', 0, 'y']) // 123 + * ``` + */ + getIn(searchKeyPath: Iterable, notSetValue?: unknown): unknown; + + /** + * True if the result of following a path of keys or indices through nested + * Collections results in a set value. + */ + hasIn(searchKeyPath: Iterable): boolean; + + // Persistent changes + + /** + * This can be very useful as a way to "chain" a normal function into a + * sequence of methods. RxJS calls this "let" and lodash calls it "thru". + * + * For example, to sum a Seq after mapping and filtering: + * + * + * ```js + * const { Seq } = require('immutable') + * + * function sum(collection) { + * return collection.reduce((sum, x) => sum + x, 0) + * } + * + * Seq([ 1, 2, 3 ]) + * .map(x => x + 1) + * .filter(x => x % 2 === 0) + * .update(sum) + * // 6 + * ``` + */ + update(updater: (value: this) => R): R; + + // Conversion to JavaScript types + + /** + * Deeply converts this Collection to equivalent native JavaScript Array or Object. + * + * `Collection.Indexed`, and `Collection.Set` become `Array`, while + * `Collection.Keyed` become `Object`, converting keys to Strings. + */ + toJS(): Array> | { [key in PropertyKey]: DeepCopy }; + + /** + * Shallowly converts this Collection to equivalent native JavaScript Array or Object. + * + * `Collection.Indexed`, and `Collection.Set` become `Array`, while + * `Collection.Keyed` become `Object`, converting keys to Strings. + */ + toJSON(): Array | { [key in PropertyKey]: V }; + + /** + * Shallowly converts this collection to an Array. + * + * `Collection.Indexed`, and `Collection.Set` produce an Array of values. + * `Collection.Keyed` produce an Array of [key, value] tuples. + */ + toArray(): Array | Array<[K, V]>; + + /** + * Shallowly converts this Collection to an Object. + * + * Converts keys to Strings. + */ + toObject(): { [key: string]: V }; + + // Conversion to Collections + + /** + * Converts this Collection to a Map, Throws if keys are not hashable. + * + * Note: This is equivalent to `Map(this.toKeyedSeq())`, but provided + * for convenience and to allow for chained expressions. + */ + toMap(): Map; + + /** + * Converts this Collection to a Map, maintaining the order of iteration. + * + * Note: This is equivalent to `OrderedMap(this.toKeyedSeq())`, but + * provided for convenience and to allow for chained expressions. + */ + toOrderedMap(): OrderedMap; + + /** + * Converts this Collection to a Set, discarding keys. Throws if values + * are not hashable. + * + * Note: This is equivalent to `Set(this)`, but provided to allow for + * chained expressions. + */ + toSet(): Set; + + /** + * Converts this Collection to a Set, maintaining the order of iteration and + * discarding keys. + * + * Note: This is equivalent to `OrderedSet(this.valueSeq())`, but provided + * for convenience and to allow for chained expressions. + */ + toOrderedSet(): OrderedSet; + + /** + * Converts this Collection to a List, discarding keys. + * + * This is similar to `List(collection)`, but provided to allow for chained + * expressions. However, when called on `Map` or other keyed collections, + * `collection.toList()` discards the keys and creates a list of only the + * values, whereas `List(collection)` creates a list of entry tuples. + * + * + * ```js + * const { Map, List } = require('immutable') + * var myMap = Map({ a: 'Apple', b: 'Banana' }) + * List(myMap) // List [ [ "a", "Apple" ], [ "b", "Banana" ] ] + * myMap.toList() // List [ "Apple", "Banana" ] + * ``` + */ + toList(): List; + + /** + * Converts this Collection to a Stack, discarding keys. Throws if values + * are not hashable. + * + * Note: This is equivalent to `Stack(this)`, but provided to allow for + * chained expressions. + */ + toStack(): Stack; + + // Conversion to Seq + + /** + * Converts this Collection to a Seq of the same kind (indexed, + * keyed, or set). + */ + toSeq(): Seq; + + /** + * Returns a Seq.Keyed from this Collection where indices are treated as keys. + * + * This is useful if you want to operate on an + * Collection.Indexed and preserve the [index, value] pairs. + * + * The returned Seq will have identical iteration order as + * this Collection. + * + * + * ```js + * const { Seq } = require('immutable') + * const indexedSeq = Seq([ 'A', 'B', 'C' ]) + * // Seq [ "A", "B", "C" ] + * indexedSeq.filter(v => v === 'B') + * // Seq [ "B" ] + * const keyedSeq = indexedSeq.toKeyedSeq() + * // Seq { 0: "A", 1: "B", 2: "C" } + * keyedSeq.filter(v => v === 'B') + * // Seq { 1: "B" } + * ``` + */ + toKeyedSeq(): Seq.Keyed; + + /** + * Returns an Seq.Indexed of the values of this Collection, discarding keys. + */ + toIndexedSeq(): Seq.Indexed; + + /** + * Returns a Seq.Set of the values of this Collection, discarding keys. + */ + toSetSeq(): Seq.Set; + + // Iterators + + /** + * An iterator of this `Collection`'s keys. + * + * Note: this will return an ES6 iterator which does not support + * Immutable.js sequence algorithms. Use `keySeq` instead, if this is + * what you want. + */ + keys(): IterableIterator; + + /** + * An iterator of this `Collection`'s values. + * + * Note: this will return an ES6 iterator which does not support + * Immutable.js sequence algorithms. Use `valueSeq` instead, if this is + * what you want. + */ + values(): IterableIterator; + + /** + * An iterator of this `Collection`'s entries as `[ key, value ]` tuples. + * + * Note: this will return an ES6 iterator which does not support + * Immutable.js sequence algorithms. Use `entrySeq` instead, if this is + * what you want. + */ + entries(): IterableIterator<[K, V]>; + + [Symbol.iterator](): IterableIterator; + + // Collections (Seq) + + /** + * Returns a new Seq.Indexed of the keys of this Collection, + * discarding values. + */ + keySeq(): Seq.Indexed; + + /** + * Returns an Seq.Indexed of the values of this Collection, discarding keys. + */ + valueSeq(): Seq.Indexed; + + /** + * Returns a new Seq.Indexed of [key, value] tuples. + */ + entrySeq(): Seq.Indexed<[K, V]>; + + // Sequence algorithms + + /** + * Returns a new Collection of the same type with values passed through a + * `mapper` function. + * + * + * ```js + * const { Collection } = require('immutable') + * Collection({ a: 1, b: 2 }).map(x => 10 * x) + * // Seq { "a": 10, "b": 20 } + * ``` + * + * Note: `map()` always returns a new instance, even if it produced the same + * value at every step. + */ + map( + mapper: (value: V, key: K, iter: this) => M, + context?: unknown + ): Collection; + + /** + * Note: used only for sets, which return Collection but are otherwise + * identical to normal `map()`. + * + * @ignore + */ + map(...args: Array): unknown; + + /** + * Returns a new Collection of the same type with only the entries for which + * the `predicate` function returns true. + * + * + * ```js + * const { Map } = require('immutable') + * Map({ a: 1, b: 2, c: 3, d: 4}).filter(x => x % 2 === 0) + * // Map { "b": 2, "d": 4 } + * ``` + * + * Note: `filter()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filter( + predicate: (value: V, key: K, iter: this) => value is F, + context?: unknown + ): Collection; + filter( + predicate: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): this; + + /** + * Returns a new Collection of the same type with only the entries for which + * the `predicate` function returns false. + * + * + * ```js + * const { Map } = require('immutable') + * Map({ a: 1, b: 2, c: 3, d: 4}).filterNot(x => x % 2 === 0) + * // Map { "a": 1, "c": 3 } + * ``` + * + * Note: `filterNot()` always returns a new instance, even if it results in + * not filtering out any values. + */ + filterNot( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): this; + + /** + * Returns a new Collection with the values for which the `predicate` + * function returns false and another for which is returns true. + */ + partition( + predicate: (this: C, value: V, key: K, iter: this) => value is F, + context?: C + ): [Collection, Collection]; + partition( + predicate: (this: C, value: V, key: K, iter: this) => unknown, + context?: C + ): [this, this]; + + /** + * Returns a new Collection of the same type in reverse order. + */ + reverse(): this; + + /** + * Returns a new Collection of the same type which includes the same entries, + * stably sorted by using a `comparator`. + * + * If a `comparator` is not provided, a default comparator uses `<` and `>`. + * + * `comparator(valueA, valueB)`: + * + * * Returns `0` if the elements should not be swapped. + * * Returns `-1` (or any negative number) if `valueA` comes before `valueB` + * * Returns `1` (or any positive number) if `valueA` comes after `valueB` + * * Alternatively, can return a value of the `PairSorting` enum type + * * Is pure, i.e. it must always return the same value for the same pair + * of values. + * + * When sorting collections which have no defined order, their ordered + * equivalents will be returned. e.g. `map.sort()` returns OrderedMap. + * + * + * ```js + * const { Map } = require('immutable') + * Map({ "c": 3, "a": 1, "b": 2 }).sort((a, b) => { + * if (a < b) { return -1; } + * if (a > b) { return 1; } + * if (a === b) { return 0; } + * }); + * // OrderedMap { "a": 1, "b": 2, "c": 3 } + * ``` + * + * Note: `sort()` Always returns a new instance, even if the original was + * already sorted. + * + * Note: This is always an eager operation. + */ + sort(comparator?: Comparator): this; + + /** + * Like `sort`, but also accepts a `comparatorValueMapper` which allows for + * sorting by more sophisticated means: + * + * + * ```js + * const { Map } = require('immutable') + * const beattles = Map({ + * John: { name: "Lennon" }, + * Paul: { name: "McCartney" }, + * George: { name: "Harrison" }, + * Ringo: { name: "Starr" }, + * }); + * beattles.sortBy(member => member.name); + * ``` + * + * Note: `sortBy()` Always returns a new instance, even if the original was + * already sorted. + * + * Note: This is always an eager operation. + */ + sortBy( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: Comparator + ): this; + + /** + * Returns a `Map` of `Collection`, grouped by the return + * value of the `grouper` function. + * + * Note: This is always an eager operation. + * + * + * ```js + * const { List, Map } = require('immutable') + * const listOfMaps = List([ + * Map({ v: 0 }), + * Map({ v: 1 }), + * Map({ v: 1 }), + * Map({ v: 0 }), + * Map({ v: 2 }) + * ]) + * const groupsOfMaps = listOfMaps.groupBy(x => x.get('v')) + * // Map { + * // 0: List [ Map{ "v": 0 }, Map { "v": 0 } ], + * // 1: List [ Map{ "v": 1 }, Map { "v": 1 } ], + * // 2: List [ Map{ "v": 2 } ], + * // } + * ``` + */ + groupBy( + grouper: (value: V, key: K, iter: this) => G, + context?: unknown + ): Map; + + // Side effects + + /** + * The `sideEffect` is executed for every entry in the Collection. + * + * Unlike `Array#forEach`, if any call of `sideEffect` returns + * `false`, the iteration will stop. Returns the number of entries iterated + * (including the last iteration which returned false). + */ + forEach( + sideEffect: (value: V, key: K, iter: this) => unknown, + context?: unknown + ): number; + + // Creating subsets + + /** + * Returns a new Collection of the same type representing a portion of this + * Collection from start up to but not including end. + * + * If begin is negative, it is offset from the end of the Collection. e.g. + * `slice(-2)` returns a Collection of the last two entries. If it is not + * provided the new Collection will begin at the beginning of this Collection. + * + * If end is negative, it is offset from the end of the Collection. e.g. + * `slice(0, -1)` returns a Collection of everything but the last entry. If + * it is not provided, the new Collection will continue through the end of + * this Collection. + * + * If the requested slice is equivalent to the current Collection, then it + * will return itself. + */ + slice(begin?: number, end?: number): this; + + /** + * Returns a new Collection of the same type containing all entries except + * the first. + */ + rest(): this; + + /** + * Returns a new Collection of the same type containing all entries except + * the last. + */ + butLast(): this; + + /** + * Returns a new Collection of the same type which excludes the first `amount` + * entries from this Collection. + */ + skip(amount: number): this; + + /** + * Returns a new Collection of the same type which excludes the last `amount` + * entries from this Collection. + */ + skipLast(amount: number): this; + + /** + * Returns a new Collection of the same type which includes entries starting + * from when `predicate` first returns false. + * + * + * ```js + * const { List } = require('immutable') + * List([ 'dog', 'frog', 'cat', 'hat', 'god' ]) + * .skipWhile(x => x.match(/g/)) + * // List [ "cat", "hat", "god" ] + * ``` + */ + skipWhile( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): this; + + /** + * Returns a new Collection of the same type which includes entries starting + * from when `predicate` first returns true. + * + * + * ```js + * const { List } = require('immutable') + * List([ 'dog', 'frog', 'cat', 'hat', 'god' ]) + * .skipUntil(x => x.match(/hat/)) + * // List [ "hat", "god" ] + * ``` + */ + skipUntil( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): this; + + /** + * Returns a new Collection of the same type which includes the first `amount` + * entries from this Collection. + */ + take(amount: number): this; + + /** + * Returns a new Collection of the same type which includes the last `amount` + * entries from this Collection. + */ + takeLast(amount: number): this; + + /** + * Returns a new Collection of the same type which includes entries from this + * Collection as long as the `predicate` returns true. + * + * + * ```js + * const { List } = require('immutable') + * List([ 'dog', 'frog', 'cat', 'hat', 'god' ]) + * .takeWhile(x => x.match(/o/)) + * // List [ "dog", "frog" ] + * ``` + */ + takeWhile( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): this; + + /** + * Returns a new Collection of the same type which includes entries from this + * Collection as long as the `predicate` returns false. + * + * + * ```js + * const { List } = require('immutable') + * List([ 'dog', 'frog', 'cat', 'hat', 'god' ]) + * .takeUntil(x => x.match(/at/)) + * // List [ "dog", "frog" ] + * ``` + */ + takeUntil( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): this; + + // Combination + + /** + * Returns a new Collection of the same type with other values and + * collection-like concatenated to this one. + * + * For Seqs, all entries will be present in the resulting Seq, even if they + * have the same key. + */ + concat( + ...valuesOrCollections: Array + ): Collection; + + /** + * Flattens nested Collections. + * + * Will deeply flatten the Collection by default, returning a Collection of the + * same type, but a `depth` can be provided in the form of a number or + * boolean (where true means to shallowly flatten one level). A depth of 0 + * (or shallow: false) will deeply flatten. + * + * Flattens only others Collection, not Arrays or Objects. + * + * Note: `flatten(true)` operates on Collection> and + * returns Collection + */ + flatten(depth?: number): Collection; + flatten(shallow?: boolean): Collection; + + /** + * Flat-maps the Collection, returning a Collection of the same type. + * + * Similar to `collection.map(...).flatten(true)`. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable, + context?: unknown + ): Collection; + + /** + * Flat-maps the Collection, returning a Collection of the same type. + * + * Similar to `collection.map(...).flatten(true)`. + * Used for Dictionaries only. + */ + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: unknown + ): Collection; + + // Reducing a value + + /** + * Reduces the Collection to a value by calling the `reducer` for every entry + * in the Collection and passing along the reduced value. + * + * If `initialReduction` is not provided, the first item in the + * Collection will be used. + * + * @see `Array#reduce`. + */ + reduce( + reducer: (reduction: R, value: V, key: K, iter: this) => R, + initialReduction: R, + context?: unknown + ): R; + reduce( + reducer: (reduction: V | R, value: V, key: K, iter: this) => R + ): R; + + /** + * Reduces the Collection in reverse (from the right side). + * + * Note: Similar to this.reverse().reduce(), and provided for parity + * with `Array#reduceRight`. + */ + reduceRight( + reducer: (reduction: R, value: V, key: K, iter: this) => R, + initialReduction: R, + context?: unknown + ): R; + reduceRight( + reducer: (reduction: V | R, value: V, key: K, iter: this) => R + ): R; + + /** + * True if `predicate` returns true for all entries in the Collection. + */ + every( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): boolean; + + /** + * True if `predicate` returns true for any entry in the Collection. + */ + some( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): boolean; + + /** + * Joins values together as a string, inserting a separator between each. + * The default separator is `","`. + */ + join(separator?: string): string; + + /** + * Returns true if this Collection includes no values. + * + * For some lazy `Seq`, `isEmpty` might need to iterate to determine + * emptiness. At most one iteration will occur. + */ + isEmpty(): boolean; + + /** + * Returns the size of this Collection. + * + * Regardless of if this Collection can describe its size lazily (some Seqs + * cannot), this method will always return the correct size. E.g. it + * evaluates a lazy `Seq` if necessary. + * + * If `predicate` is provided, then this returns the count of entries in the + * Collection for which the `predicate` returns true. + */ + count(): number; + count( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): number; + + /** + * Returns a `Seq.Keyed` of counts, grouped by the return value of + * the `grouper` function. + * + * Note: This is not a lazy operation. + */ + countBy( + grouper: (value: V, key: K, iter: this) => G, + context?: unknown + ): Map; + + // Search for value + + /** + * Returns the first value for which the `predicate` returns true. + */ + find( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown, + notSetValue?: V + ): V | undefined; + + /** + * Returns the last value for which the `predicate` returns true. + * + * Note: `predicate` will be called for each entry in reverse. + */ + findLast( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown, + notSetValue?: V + ): V | undefined; + + /** + * Returns the first [key, value] entry for which the `predicate` returns true. + */ + findEntry( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown, + notSetValue?: V + ): [K, V] | undefined; + + /** + * Returns the last [key, value] entry for which the `predicate` + * returns true. + * + * Note: `predicate` will be called for each entry in reverse. + */ + findLastEntry( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown, + notSetValue?: V + ): [K, V] | undefined; + + /** + * Returns the key for which the `predicate` returns true. + */ + findKey( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): K | undefined; + + /** + * Returns the last key for which the `predicate` returns true. + * + * Note: `predicate` will be called for each entry in reverse. + */ + findLastKey( + predicate: (value: V, key: K, iter: this) => boolean, + context?: unknown + ): K | undefined; + + /** + * Returns the key associated with the search value, or undefined. + */ + keyOf(searchValue: V): K | undefined; + + /** + * Returns the last key associated with the search value, or undefined. + */ + lastKeyOf(searchValue: V): K | undefined; + + /** + * Returns the maximum value in this collection. If any values are + * comparatively equivalent, the first one found will be returned. + * + * The `comparator` is used in the same way as `Collection#sort`. If it is not + * provided, the default comparator is `>`. + * + * When two values are considered equivalent, the first encountered will be + * returned. Otherwise, `max` will operate independent of the order of input + * as long as the comparator is commutative. The default comparator `>` is + * commutative *only* when types do not differ. + * + * If `comparator` returns 0 and either value is NaN, undefined, or null, + * that value will be returned. + */ + max(comparator?: Comparator): V | undefined; + + /** + * Like `max`, but also accepts a `comparatorValueMapper` which allows for + * comparing by more sophisticated means: + * + * + * ```js + * const { List, } = require('immutable'); + * const l = List([ + * { name: 'Bob', avgHit: 1 }, + * { name: 'Max', avgHit: 3 }, + * { name: 'Lili', avgHit: 2 } , + * ]); + * l.maxBy(i => i.avgHit); // will output { name: 'Max', avgHit: 3 } + * ``` + */ + maxBy( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: Comparator + ): V | undefined; + + /** + * Returns the minimum value in this collection. If any values are + * comparatively equivalent, the first one found will be returned. + * + * The `comparator` is used in the same way as `Collection#sort`. If it is not + * provided, the default comparator is `<`. + * + * When two values are considered equivalent, the first encountered will be + * returned. Otherwise, `min` will operate independent of the order of input + * as long as the comparator is commutative. The default comparator `<` is + * commutative *only* when types do not differ. + * + * If `comparator` returns 0 and either value is NaN, undefined, or null, + * that value will be returned. + */ + min(comparator?: Comparator): V | undefined; + + /** + * Like `min`, but also accepts a `comparatorValueMapper` which allows for + * comparing by more sophisticated means: + * + * + * ```js + * const { List, } = require('immutable'); + * const l = List([ + * { name: 'Bob', avgHit: 1 }, + * { name: 'Max', avgHit: 3 }, + * { name: 'Lili', avgHit: 2 } , + * ]); + * l.minBy(i => i.avgHit); // will output { name: 'Bob', avgHit: 1 } + * ``` + */ + minBy( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: Comparator + ): V | undefined; + + // Comparison + + /** + * True if `iter` includes every value in this Collection. + */ + isSubset(iter: Iterable): boolean; + + /** + * True if this Collection includes every value in `iter`. + */ + isSuperset(iter: Iterable): boolean; + } + + /** + * The interface to fulfill to qualify as a Value Object. + */ + interface ValueObject { + /** + * True if this and the other Collection have value equality, as defined + * by `Immutable.is()`. + * + * Note: This is equivalent to `Immutable.is(this, other)`, but provided to + * allow for chained expressions. + */ + equals(other: unknown): boolean; + + /** + * Computes and returns the hashed identity for this Collection. + * + * The `hashCode` of a Collection is used to determine potential equality, + * and is used when adding this to a `Set` or as a key in a `Map`, enabling + * lookup via a different instance. + * + * + * ```js + * const { List, Set } = require('immutable'); + * const a = List([ 1, 2, 3 ]); + * const b = List([ 1, 2, 3 ]); + * assert.notStrictEqual(a, b); // different instances + * const set = Set([ a ]); + * assert.equal(set.has(b), true); + * ``` + * + * Note: hashCode() MUST return a Uint32 number. The easiest way to + * guarantee this is to return `myHash | 0` from a custom implementation. + * + * If two values have the same `hashCode`, they are [not guaranteed + * to be equal][Hash Collision]. If two values have different `hashCode`s, + * they must not be equal. + * + * Note: `hashCode()` is not guaranteed to always be called before + * `equals()`. Most but not all Immutable.js collections use hash codes to + * organize their internal data structures, while all Immutable.js + * collections use equality during lookups. + * + * [Hash Collision]: https://en.wikipedia.org/wiki/Collision_(computer_science) + */ + hashCode(): number; + } + + /** + * Interface representing all oredered collections. + * This includes `List`, `Stack`, `Map`, `OrderedMap`, `Set`, and `OrderedSet`. + * return of `isOrdered()` return true in that case. + */ + interface OrderedCollection { + /** + * Shallowly converts this collection to an Array. + */ + toArray(): Array; + + [Symbol.iterator](): IterableIterator; + } + + /** + * Deeply converts plain JS objects and arrays to Immutable Maps and Lists. + * + * `fromJS` will convert Arrays and [array-like objects][2] to a List, and + * plain objects (without a custom prototype) to a Map. [Iterable objects][3] + * may be converted to List, Map, or Set. + * + * If a `reviver` is optionally provided, it will be called with every + * collection as a Seq (beginning with the most nested collections + * and proceeding to the top-level collection itself), along with the key + * referring to each collection and the parent JS object provided as `this`. + * For the top level, object, the key will be `""`. This `reviver` is expected + * to return a new Immutable Collection, allowing for custom conversions from + * deep JS objects. Finally, a `path` is provided which is the sequence of + * keys to this value from the starting value. + * + * `reviver` acts similarly to the [same parameter in `JSON.parse`][1]. + * + * If `reviver` is not provided, the default behavior will convert Objects + * into Maps and Arrays into Lists like so: + * + * + * ```js + * const { fromJS, isKeyed } = require('immutable') + * function (key, value) { + * return isKeyed(value) ? value.toMap() : value.toList() + * } + * ``` + * + * Accordingly, this example converts native JS data to OrderedMap and List: + * + * + * ```js + * const { fromJS, isKeyed } = require('immutable') + * fromJS({ a: {b: [10, 20, 30]}, c: 40}, function (key, value, path) { + * console.log(key, value, path) + * return isKeyed(value) ? value.toOrderedMap() : value.toList() + * }) + * + * > "b", [ 10, 20, 30 ], [ "a", "b" ] + * > "a", {b: [10, 20, 30]}, [ "a" ] + * > "", {a: {b: [10, 20, 30]}, c: 40}, [] + * ``` + * + * Keep in mind, when using JS objects to construct Immutable Maps, that + * JavaScript Object properties are always strings, even if written in a + * quote-less shorthand, while Immutable Maps accept keys of any type. + * + * + * ```js + * const { Map } = require('immutable') + * let obj = { 1: "one" }; + * Object.keys(obj); // [ "1" ] + * assert.equal(obj["1"], obj[1]); // "one" === "one" + * + * let map = Map(obj); + * assert.notEqual(map.get("1"), map.get(1)); // "one" !== undefined + * ``` + * + * Property access for JavaScript Objects first converts the key to a string, + * but since Immutable Map keys can be of any type the argument to `get()` is + * not altered. + * + * [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter + * "Using the reviver parameter" + * [2]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Indexed_collections#working_with_array-like_objects + * "Working with array-like objects" + * [3]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterable_protocol + * "The iterable protocol" + */ + function fromJS( + jsValue: JSValue, + reviver?: undefined + ): FromJS; + function fromJS( + jsValue: unknown, + reviver?: ( + key: string | number, + sequence: Collection.Keyed | Collection.Indexed, + path?: Array + ) => unknown + ): Collection; + + type FromJS = JSValue extends FromJSNoTransform + ? JSValue + : JSValue extends Array + ? FromJSArray + : JSValue extends object + ? FromJSObject + : unknown; + + type FromJSNoTransform = + | Collection + | number + | string + | null + | undefined; + + type FromJSArray = + JSValue extends Array ? List> : never; + + type FromJSObject = JSValue extends object + ? Map> + : never; + + /** + * Value equality check with semantics similar to `Object.is`, but treats + * Immutable `Collection`s as values, equal if the second `Collection` includes + * equivalent values. + * + * It's used throughout Immutable when checking for equality, including `Map` + * key equality and `Set` membership. + * + * + * ```js + * const { Map, is } = require('immutable') + * const map1 = Map({ a: 1, b: 1, c: 1 }) + * const map2 = Map({ a: 1, b: 1, c: 1 }) + * assert.equal(map1 !== map2, true) + * assert.equal(Object.is(map1, map2), false) + * assert.equal(is(map1, map2), true) + * ``` + * + * `is()` compares primitive types like strings and numbers, Immutable.js + * collections like `Map` and `List`, but also any custom object which + * implements `ValueObject` by providing `equals()` and `hashCode()` methods. + * + * Note: Unlike `Object.is`, `Immutable.is` assumes `0` and `-0` are the same + * value, matching the behavior of ES6 Map key equality. + */ + function is(first: unknown, second: unknown): boolean; + + /** + * The `hash()` function is an important part of how Immutable determines if + * two values are equivalent and is used to determine how to store those + * values. Provided with any value, `hash()` will return a 31-bit integer. + * + * When designing Objects which may be equal, it's important that when a + * `.equals()` method returns true, that both values `.hashCode()` method + * return the same value. `hash()` may be used to produce those values. + * + * For non-Immutable Objects that do not provide a `.hashCode()` functions + * (including plain Objects, plain Arrays, Date objects, etc), a unique hash + * value will be created for each *instance*. That is, the create hash + * represents referential equality, and not value equality for Objects. This + * ensures that if that Object is mutated over time that its hash code will + * remain consistent, allowing Objects to be used as keys and values in + * Immutable.js collections. + * + * Note that `hash()` attempts to balance between speed and avoiding + * collisions, however it makes no attempt to produce secure hashes. + * + * *New in Version 4.0* + */ + function hash(value: unknown): number; + + /** + * True if `maybeImmutable` is an Immutable Collection or Record. + * + * Note: Still returns true even if the collections is within a `withMutations()`. + * + * + * ```js + * const { isImmutable, Map, List, Stack } = require('immutable'); + * isImmutable([]); // false + * isImmutable({}); // false + * isImmutable(Map()); // true + * isImmutable(List()); // true + * isImmutable(Stack()); // true + * isImmutable(Map().asMutable()); // true + * ``` + */ + function isImmutable( + maybeImmutable: unknown + ): maybeImmutable is Collection; + + /** + * True if `maybeCollection` is a Collection, or any of its subclasses. + * + * + * ```js + * const { isCollection, Map, List, Stack } = require('immutable'); + * isCollection([]); // false + * isCollection({}); // false + * isCollection(Map()); // true + * isCollection(List()); // true + * isCollection(Stack()); // true + * ``` + */ + function isCollection( + maybeCollection: unknown + ): maybeCollection is Collection; + + /** + * True if `maybeKeyed` is a Collection.Keyed, or any of its subclasses. + * + * + * ```js + * const { isKeyed, Map, List, Stack } = require('immutable'); + * isKeyed([]); // false + * isKeyed({}); // false + * isKeyed(Map()); // true + * isKeyed(List()); // false + * isKeyed(Stack()); // false + * ``` + */ + function isKeyed( + maybeKeyed: unknown + ): maybeKeyed is Collection.Keyed; + + /** + * True if `maybeIndexed` is a Collection.Indexed, or any of its subclasses. + * + * + * ```js + * const { isIndexed, Map, List, Stack, Set } = require('immutable'); + * isIndexed([]); // false + * isIndexed({}); // false + * isIndexed(Map()); // false + * isIndexed(List()); // true + * isIndexed(Stack()); // true + * isIndexed(Set()); // false + * ``` + */ + function isIndexed( + maybeIndexed: unknown + ): maybeIndexed is Collection.Indexed; + + /** + * True if `maybeAssociative` is either a Keyed or Indexed Collection. + * + * + * ```js + * const { isAssociative, Map, List, Stack, Set } = require('immutable'); + * isAssociative([]); // false + * isAssociative({}); // false + * isAssociative(Map()); // true + * isAssociative(List()); // true + * isAssociative(Stack()); // true + * isAssociative(Set()); // false + * ``` + */ + function isAssociative( + maybeAssociative: unknown + ): maybeAssociative is + | Collection.Keyed + | Collection.Indexed; + + /** + * True if `maybeOrdered` is a Collection where iteration order is well + * defined. True for Collection.Indexed as well as OrderedMap and OrderedSet. + * + * + * ```js + * const { isOrdered, Map, OrderedMap, List, Set } = require('immutable'); + * isOrdered([]); // false + * isOrdered({}); // false + * isOrdered(Map()); // false + * isOrdered(OrderedMap()); // true + * isOrdered(List()); // true + * isOrdered(Set()); // false + * ``` + */ + function isOrdered( + maybeOrdered: Iterable + ): maybeOrdered is OrderedCollection; + function isOrdered( + maybeOrdered: unknown + ): maybeOrdered is OrderedCollection; + + /** + * True if `maybeValue` is a JavaScript Object which has *both* `equals()` + * and `hashCode()` methods. + * + * Any two instances of *value objects* can be compared for value equality with + * `Immutable.is()` and can be used as keys in a `Map` or members in a `Set`. + */ + function isValueObject(maybeValue: unknown): maybeValue is ValueObject; + + /** + * True if `maybeSeq` is a Seq. + */ + function isSeq( + maybeSeq: unknown + ): maybeSeq is + | Seq.Indexed + | Seq.Keyed + | Seq.Set; + + /** + * True if `maybeList` is a List. + */ + function isList(maybeList: unknown): maybeList is List; + + /** + * True if `maybeMap` is a Map. + * + * Also true for OrderedMaps. + */ + function isMap(maybeMap: unknown): maybeMap is Map; + + /** + * True if `maybeOrderedMap` is an OrderedMap. + */ + function isOrderedMap( + maybeOrderedMap: unknown + ): maybeOrderedMap is OrderedMap; + + /** + * True if `maybeStack` is a Stack. + */ + function isStack(maybeStack: unknown): maybeStack is Stack; + + /** + * True if `maybeSet` is a Set. + * + * Also true for OrderedSets. + */ + function isSet(maybeSet: unknown): maybeSet is Set; + + /** + * True if `maybeOrderedSet` is an OrderedSet. + */ + function isOrderedSet( + maybeOrderedSet: unknown + ): maybeOrderedSet is OrderedSet; + + /** + * True if `maybeRecord` is a Record. + */ + function isRecord(maybeRecord: unknown): maybeRecord is Record; + + /** + * Returns the value within the provided collection associated with the + * provided key, or notSetValue if the key is not defined in the collection. + * + * A functional alternative to `collection.get(key)` which will also work on + * plain Objects and Arrays as an alternative for `collection[key]`. + * + * + * ```js + * const { get } = require('immutable') + * get([ 'dog', 'frog', 'cat' ], 2) // 'frog' + * get({ x: 123, y: 456 }, 'x') // 123 + * get({ x: 123, y: 456 }, 'z', 'ifNotSet') // 'ifNotSet' + * ``` + */ + function get(collection: Collection, key: K): V | undefined; + function get( + collection: Collection, + key: K, + notSetValue: NSV + ): V | NSV; + function get( + record: Record, + key: K, + notSetValue: unknown + ): TProps[K]; + function get(collection: Array, key: number): V | undefined; + function get( + collection: Array, + key: number, + notSetValue: NSV + ): V | NSV; + function get( + object: C, + key: K, + notSetValue: unknown + ): C[K]; + function get( + collection: { [key: PropertyKey]: V }, + key: string + ): V | undefined; + function get( + collection: { [key: PropertyKey]: V }, + key: string, + notSetValue: NSV + ): V | NSV; + + /** + * Returns true if the key is defined in the provided collection. + * + * A functional alternative to `collection.has(key)` which will also work with + * plain Objects and Arrays as an alternative for + * `collection.hasOwnProperty(key)`. + * + * + * ```js + * const { has } = require('immutable') + * has([ 'dog', 'frog', 'cat' ], 2) // true + * has([ 'dog', 'frog', 'cat' ], 5) // false + * has({ x: 123, y: 456 }, 'x') // true + * has({ x: 123, y: 456 }, 'z') // false + * ``` + */ + function has(collection: object, key: unknown): boolean; + + /** + * Returns a copy of the collection with the value at key removed. + * + * A functional alternative to `collection.remove(key)` which will also work + * with plain Objects and Arrays as an alternative for + * `delete collectionCopy[key]`. + * + * + * ```js + * const { remove } = require('immutable') + * const originalArray = [ 'dog', 'frog', 'cat' ] + * remove(originalArray, 1) // [ 'dog', 'cat' ] + * console.log(originalArray) // [ 'dog', 'frog', 'cat' ] + * const originalObject = { x: 123, y: 456 } + * remove(originalObject, 'x') // { y: 456 } + * console.log(originalObject) // { x: 123, y: 456 } + * ``` + */ + function remove>( + collection: C, + key: K + ): C; + function remove< + TProps extends object, + C extends Record, + K extends keyof TProps, + >(collection: C, key: K): C; + function remove>(collection: C, key: number): C; + function remove(collection: C, key: K): C; + function remove( + collection: C, + key: K + ): C; + + /** + * Returns a copy of the collection with the value at key set to the provided + * value. + * + * A functional alternative to `collection.set(key, value)` which will also + * work with plain Objects and Arrays as an alternative for + * `collectionCopy[key] = value`. + * + * + * ```js + * const { set } = require('immutable') + * const originalArray = [ 'dog', 'frog', 'cat' ] + * set(originalArray, 1, 'cow') // [ 'dog', 'cow', 'cat' ] + * console.log(originalArray) // [ 'dog', 'frog', 'cat' ] + * const originalObject = { x: 123, y: 456 } + * set(originalObject, 'x', 789) // { x: 789, y: 456 } + * console.log(originalObject) // { x: 123, y: 456 } + * ``` + */ + function set>( + collection: C, + key: K, + value: V + ): C; + function set< + TProps extends object, + C extends Record, + K extends keyof TProps, + >(record: C, key: K, value: TProps[K]): C; + function set>(collection: C, key: number, value: V): C; + function set(object: C, key: K, value: C[K]): C; + function set( + collection: C, + key: string, + value: V + ): C; + + /** + * Returns a copy of the collection with the value at key set to the result of + * providing the existing value to the updating function. + * + * A functional alternative to `collection.update(key, fn)` which will also + * work with plain Objects and Arrays as an alternative for + * `collectionCopy[key] = fn(collection[key])`. + * + * + * ```js + * const { update } = require('immutable') + * const originalArray = [ 'dog', 'frog', 'cat' ] + * update(originalArray, 1, val => val.toUpperCase()) // [ 'dog', 'FROG', 'cat' ] + * console.log(originalArray) // [ 'dog', 'frog', 'cat' ] + * const originalObject = { x: 123, y: 456 } + * update(originalObject, 'x', val => val * 6) // { x: 738, y: 456 } + * console.log(originalObject) // { x: 123, y: 456 } + * ``` + */ + function update>( + collection: C, + key: K, + updater: (value: V | undefined) => V | undefined + ): C; + function update, NSV>( + collection: C, + key: K, + notSetValue: NSV, + updater: (value: V | NSV) => V + ): C; + function update< + TProps extends object, + C extends Record, + K extends keyof TProps, + >(record: C, key: K, updater: (value: TProps[K]) => TProps[K]): C; + function update< + TProps extends object, + C extends Record, + K extends keyof TProps, + NSV, + >( + record: C, + key: K, + notSetValue: NSV, + updater: (value: TProps[K] | NSV) => TProps[K] + ): C; + function update( + collection: Array, + key: number, + updater: (value: V | undefined) => V | undefined + ): Array; + function update( + collection: Array, + key: number, + notSetValue: NSV, + updater: (value: V | NSV) => V + ): Array; + function update( + object: C, + key: K, + updater: (value: C[K]) => C[K] + ): C; + function update( + object: C, + key: K, + notSetValue: NSV, + updater: (value: C[K] | NSV) => C[K] + ): C; + function update( + collection: C, + key: K, + updater: (value: V) => V + ): { [key: string]: V }; + function update( + collection: C, + key: K, + notSetValue: NSV, + updater: (value: V | NSV) => V + ): { [key: string]: V }; + + // TODO `` can be used after dropping support for TypeScript 4.x + // reference: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#const-type-parameters + // after this change, `as const` assertions can be remove from the type tests + /** + * Returns the value at the provided key path starting at the provided + * collection, or notSetValue if the key path is not defined. + * + * A functional alternative to `collection.getIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * const { getIn } = require('immutable') + * getIn({ x: { y: { z: 123 }}}, ['x', 'y', 'z']) // 123 + * getIn({ x: { y: { z: 123 }}}, ['x', 'q', 'p'], 'ifNotSet') // 'ifNotSet' + * ``` + */ + function getIn>( + object: C, + keyPath: [...P] + ): RetrievePath; + function getIn>(object: C, keyPath: P): unknown; + function getIn, NSV>( + collection: C, + keyPath: [...P], + notSetValue: NSV + ): RetrievePath extends never ? NSV : RetrievePath; + function getIn, NSV>( + object: C, + keyPath: P, + notSetValue: NSV + ): unknown; + + /** + * Returns true if the key path is defined in the provided collection. + * + * A functional alternative to `collection.hasIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * const { hasIn } = require('immutable') + * hasIn({ x: { y: { z: 123 }}}, ['x', 'y', 'z']) // true + * hasIn({ x: { y: { z: 123 }}}, ['x', 'q', 'p']) // false + * ``` + */ + function hasIn( + collection: string | boolean | number, + keyPath: KeyPath + ): never; + function hasIn(collection: unknown, keyPath: KeyPath): boolean; + + /** + * Returns a copy of the collection with the value at the key path removed. + * + * A functional alternative to `collection.removeIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * const { removeIn } = require('immutable') + * const original = { x: { y: { z: 123 }}} + * removeIn(original, ['x', 'y', 'z']) // { x: { y: {}}} + * console.log(original) // { x: { y: { z: 123 }}} + * ``` + */ + function removeIn(collection: C, keyPath: Iterable): C; + + /** + * Returns a copy of the collection with the value at the key path set to the + * provided value. + * + * A functional alternative to `collection.setIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * const { setIn } = require('immutable') + * const original = { x: { y: { z: 123 }}} + * setIn(original, ['x', 'y', 'z'], 456) // { x: { y: { z: 456 }}} + * console.log(original) // { x: { y: { z: 123 }}} + * ``` + */ + function setIn( + collection: C, + keyPath: Iterable, + value: unknown + ): C; + + /** + * Returns a copy of the collection with the value at key path set to the + * result of providing the existing value to the updating function. + * + * A functional alternative to `collection.updateIn(keypath)` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * const { updateIn } = require('immutable') + * const original = { x: { y: { z: 123 }}} + * updateIn(original, ['x', 'y', 'z'], val => val * 6) // { x: { y: { z: 738 }}} + * console.log(original) // { x: { y: { z: 123 }}} + * ``` + */ + function updateIn>( + collection: C, + keyPath: KeyPath, + updater: ( + value: RetrievePath> | undefined + ) => unknown | undefined + ): C; + function updateIn, NSV>( + collection: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: (value: RetrievePath> | NSV) => unknown + ): C; + function updateIn< + TProps extends object, + C extends Record, + K extends keyof TProps, + >( + record: C, + keyPath: KeyPath, + updater: (value: RetrievePath>) => unknown + ): C; + function updateIn< + TProps extends object, + C extends Record, + K extends keyof TProps, + NSV, + >( + record: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: (value: RetrievePath> | NSV) => unknown + ): C; + function updateIn>( + collection: Array, + keyPath: KeyPath, + updater: ( + value: RetrievePath> | undefined + ) => unknown | undefined + ): Array; + function updateIn, NSV>( + collection: Array, + keyPath: KeyPath, + notSetValue: NSV, + updater: (value: RetrievePath> | NSV) => unknown + ): Array; + function updateIn( + object: C, + keyPath: KeyPath, + updater: (value: RetrievePath>) => unknown + ): C; + function updateIn( + object: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: (value: RetrievePath> | NSV) => unknown + ): C; + function updateIn< + K extends PropertyKey, + V, + C extends { [key: PropertyKey]: V }, + >( + collection: C, + keyPath: KeyPath, + updater: (value: RetrievePath>) => unknown + ): { [key: PropertyKey]: V }; + function updateIn< + K extends PropertyKey, + V, + C extends { [key: PropertyKey]: V }, + NSV, + >( + collection: C, + keyPath: KeyPath, + notSetValue: NSV, + updater: (value: RetrievePath> | NSV) => unknown + ): { [key: PropertyKey]: V }; + + /** + * Returns a copy of the collection with the remaining collections merged in. + * + * A functional alternative to `collection.merge()` which will also work with + * plain Objects and Arrays. + * + * + * ```js + * const { merge } = require('immutable') + * const original = { x: 123, y: 456 } + * merge(original, { y: 789, z: 'abc' }) // { x: 123, y: 789, z: 'abc' } + * console.log(original) // { x: 123, y: 456 } + * ``` + */ + function merge( + collection: C, + ...collections: Array< + | Iterable + | Iterable<[unknown, unknown]> + | { [key: string]: unknown } + > + ): C; + + /** + * Returns a copy of the collection with the remaining collections merged in, + * calling the `merger` function whenever an existing value is encountered. + * + * A functional alternative to `collection.mergeWith()` which will also work + * with plain Objects and Arrays. + * + * + * ```js + * const { mergeWith } = require('immutable') + * const original = { x: 123, y: 456 } + * mergeWith( + * (oldVal, newVal) => oldVal + newVal, + * original, + * { y: 789, z: 'abc' } + * ) // { x: 123, y: 1245, z: 'abc' } + * console.log(original) // { x: 123, y: 456 } + * ``` + */ + function mergeWith( + merger: (oldVal: unknown, newVal: unknown, key: unknown) => unknown, + collection: C, + ...collections: Array< + | Iterable + | Iterable<[unknown, unknown]> + | { [key: string]: unknown } + > + ): C; + + /** + * Like `merge()`, but when two compatible collections are encountered with + * the same key, it merges them as well, recursing deeply through the nested + * data. Two collections are considered to be compatible (and thus will be + * merged together) if they both fall into one of three categories: keyed + * (e.g., `Map`s, `Record`s, and objects), indexed (e.g., `List`s and + * arrays), or set-like (e.g., `Set`s). If they fall into separate + * categories, `mergeDeep` will replace the existing collection with the + * collection being merged in. This behavior can be customized by using + * `mergeDeepWith()`. + * + * Note: Indexed and set-like collections are merged using + * `concat()`/`union()` and therefore do not recurse. + * + * A functional alternative to `collection.mergeDeep()` which will also work + * with plain Objects and Arrays. + * + * + * ```js + * const { mergeDeep } = require('immutable') + * const original = { x: { y: 123 }} + * mergeDeep(original, { x: { z: 456 }}) // { x: { y: 123, z: 456 }} + * console.log(original) // { x: { y: 123 }} + * ``` + */ + function mergeDeep( + collection: C, + ...collections: Array< + | Iterable + | Iterable<[unknown, unknown]> + | { [key: string]: unknown } + > + ): C; + + /** + * Like `mergeDeep()`, but when two non-collections or incompatible + * collections are encountered at the same key, it uses the `merger` function + * to determine the resulting value. Collections are considered incompatible + * if they fall into separate categories between keyed, indexed, and set-like. + * + * A functional alternative to `collection.mergeDeepWith()` which will also + * work with plain Objects and Arrays. + * + * + * ```js + * const { mergeDeepWith } = require('immutable') + * const original = { x: { y: 123 }} + * mergeDeepWith( + * (oldVal, newVal) => oldVal + newVal, + * original, + * { x: { y: 456 }} + * ) // { x: { y: 579 }} + * console.log(original) // { x: { y: 123 }} + * ``` + */ + function mergeDeepWith( + merger: (oldVal: unknown, newVal: unknown, key: unknown) => unknown, + collection: C, + ...collections: Array< + | Iterable + | Iterable<[unknown, unknown]> + | { [key: string]: unknown } + > + ): C; +} + +/** + * Defines the main export of the immutable module to be the Immutable namespace + * This supports many common module import patterns: + * + * const Immutable = require("immutable"); + * const { List } = require("immutable"); + * import Immutable from "immutable"; + * import * as Immutable from "immutable"; + * import { List } from "immutable"; + * + */ +export = Immutable; + +/** + * A global "Immutable" namespace used by UMD modules which allows the use of + * the full Immutable API. + * + * If using Immutable as an imported module, prefer using: + * + * import Immutable from 'immutable' + * + */ +export as namespace Immutable; diff --git a/type-definitions/immutable.js.flow b/type-definitions/immutable.js.flow new file mode 100644 index 0000000000..9ab444d234 --- /dev/null +++ b/type-definitions/immutable.js.flow @@ -0,0 +1,2414 @@ +/** + * This file provides type definitions for use with the Flow type checker. + * + * An important caveat when using these definitions is that the types for + * `Collection.Keyed`, `Collection.Indexed`, `Seq.Keyed`, and so on are stubs. + * When referring to those types, you can get the proper definitions by + * importing the types `KeyedCollection`, `IndexedCollection`, `KeyedSeq`, etc. + * For example, + * + * import { Seq } from 'immutable' + * import type { IndexedCollection, IndexedSeq } from 'immutable' + * + * const someSeq: IndexedSeq = Seq.Indexed.of(1, 2, 3) + * + * function takesASeq>(iter: TS): TS { + * return iter.butLast() + * } + * + * takesASeq(someSeq) + * + * @flow strict + */ + +// Helper type that represents plain objects allowed as arguments to +// some constructors and functions. +type PlainObjInput = { +[key: K]: V, __proto__: null }; + +type K = $Keys; + +// Helper types to extract the "keys" and "values" use by the *In() methods. +type $KeyOf = $Call< + ((?_Collection) => K) & + ((?$ReadOnlyArray) => number) & + ((?RecordInstance | T) => $Keys) & + ((T) => $Keys), + C, +>; + +type $ValOf> = $Call< + ((?_Collection) => V) & + ((?$ReadOnlyArray) => T) & + (>(?RecordInstance | T, K) => $ElementType) & + ((T) => $Values), + C, + K, +>; + +type $IterableOf = $Call< + ( | IndexedCollection | SetCollection>( + V + ) => Iterable<$ValOf>) & + (< + V: + | KeyedCollection + | RecordInstance + | PlainObjInput, + >( + V + ) => Iterable<[$KeyOf, $ValOf]>), + C, +>; + +const PairSorting: $ReadOnly<{ LeftThenRight: number, RightThenLeft: number }> = + { + LeftThenRight: -1, + RightThenLeft: +1, + }; + +type Comparator = (left: T, right: T) => number; + +declare class _Collection implements ValueObject { + equals(other: mixed): boolean; + hashCode(): number; + get(key: K, ..._: []): V | void; + get(key: K, notSetValue: NSV): V | NSV; + has(key: K): boolean; + includes(value: V): boolean; + contains(value: V): boolean; + first(): V | void; + first(notSetValue: NSV): V | NSV; + last(): V | void; + last(notSetValue: NSV): V | NSV; + + hasIn(keyPath: Iterable): boolean; + + getIn(keyPath: [], notSetValue?: mixed): this; + getIn(keyPath: [K], notSetValue: NSV): V | NSV; + getIn>( + keyPath: [K, K2], + notSetValue: NSV + ): $ValOf | NSV; + getIn, K3: $KeyOf<$ValOf>>( + keyPath: [K, K2, K3], + notSetValue: NSV + ): $ValOf<$ValOf, K3> | NSV; + getIn< + NSV, + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + >( + keyPath: [K, K2, K3, K4], + notSetValue: NSV + ): $ValOf<$ValOf<$ValOf, K3>, K4> | NSV; + getIn< + NSV, + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, + >( + keyPath: [K, K2, K3, K4, K5], + notSetValue: NSV + ): $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5> | NSV; + + update(updater: (value: this) => U): U; + + toJS(): Array | { [key: string]: mixed }; + toJSON(): Array | { [key: string]: V }; + toArray(): Array | Array<[K, V]>; + toObject(): { [key: string]: V }; + toMap(): Map; + toOrderedMap(): OrderedMap; + toSet(): Set; + toOrderedSet(): OrderedSet; + toList(): List; + toStack(): Stack; + toSeq(): Seq; + toKeyedSeq(): KeyedSeq; + toIndexedSeq(): IndexedSeq; + toSetSeq(): SetSeq; + + keys(): Iterator; + values(): Iterator; + entries(): Iterator<[K, V]>; + + keySeq(): IndexedSeq; + valueSeq(): IndexedSeq; + entrySeq(): IndexedSeq<[K, V]>; + + reverse(): this; + sort(comparator?: Comparator): this; + + sortBy( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: Comparator + ): this; + + groupBy( + grouper: (value: V, key: K, iter: this) => G, + context?: mixed + ): KeyedSeq; + + forEach( + sideEffect: (value: V, key: K, iter: this) => any, + context?: mixed + ): number; + + slice(begin?: number, end?: number): this; + rest(): this; + butLast(): this; + skip(amount: number): this; + skipLast(amount: number): this; + skipWhile( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): this; + skipUntil( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): this; + take(amount: number): this; + takeLast(amount: number): this; + takeWhile( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): this; + takeUntil( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): this; + + filterNot( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): this; + + reduce( + reducer: (reduction: R, value: V, key: K, iter: this) => R, + initialReduction: R, + context?: mixed + ): R; + reduce(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R; + + reduceRight( + reducer: (reduction: R, value: V, key: K, iter: this) => R, + initialReduction: R, + context?: mixed + ): R; + reduceRight( + reducer: (reduction: V | R, value: V, key: K, iter: this) => R + ): R; + + every( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): boolean; + some( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): boolean; + join(separator?: string): string; + isEmpty(): boolean; + count( + predicate?: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): number; + countBy( + grouper: (value: V, key: K, iter: this) => G, + context?: mixed + ): Map; + + find( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed, + notSetValue?: V + ): V | void; + findLast( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed, + notSetValue?: V + ): V | void; + + findEntry(predicate: (value: V, key: K, iter: this) => mixed): [K, V] | void; + findLastEntry( + predicate: (value: V, key: K, iter: this) => mixed + ): [K, V] | void; + + findKey( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): K | void; + findLastKey( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): K | void; + + keyOf(searchValue: V): K | void; + lastKeyOf(searchValue: V): K | void; + + max(comparator?: Comparator): V; + maxBy( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: Comparator + ): V; + min(comparator?: Comparator): V; + minBy( + comparatorValueMapper: (value: V, key: K, iter: this) => C, + comparator?: Comparator + ): V; + + isSubset(iter: Iterable): boolean; + isSuperset(iter: Iterable): boolean; +} + +declare function isImmutable( + maybeImmutable: mixed +): boolean %checks(maybeImmutable instanceof Collection); +declare function isCollection( + maybeCollection: mixed +): boolean %checks(maybeCollection instanceof Collection); +declare function isKeyed( + maybeKeyed: mixed +): boolean %checks(maybeKeyed instanceof KeyedCollection); +declare function isIndexed( + maybeIndexed: mixed +): boolean %checks(maybeIndexed instanceof IndexedCollection); +declare function isAssociative( + maybeAssociative: mixed +): boolean %checks(maybeAssociative instanceof KeyedCollection || + maybeAssociative instanceof IndexedCollection); +declare function isOrdered( + maybeOrdered: mixed +): boolean %checks(maybeOrdered instanceof IndexedCollection || + maybeOrdered instanceof OrderedMap || + maybeOrdered instanceof OrderedSet); +declare function isValueObject(maybeValue: mixed): boolean; + +declare function isSeq(maybeSeq: any): boolean %checks(maybeSeq instanceof Seq); +declare function isList(maybeList: any): boolean %checks(maybeList instanceof + List); +declare function isMap(maybeMap: any): boolean %checks(maybeMap instanceof Map); +declare function isOrderedMap( + maybeOrderedMap: any +): boolean %checks(maybeOrderedMap instanceof OrderedMap); +declare function isStack(maybeStack: any): boolean %checks(maybeStack instanceof + Stack); +declare function isSet(maybeSet: any): boolean %checks(maybeSet instanceof Set); +declare function isOrderedSet( + maybeOrderedSet: any +): boolean %checks(maybeOrderedSet instanceof OrderedSet); +declare function isRecord( + maybeRecord: any +): boolean %checks(maybeRecord instanceof Record); + +declare interface ValueObject { + equals(other: mixed): boolean; + hashCode(): number; +} + +declare class Collection extends _Collection { + static Keyed: typeof KeyedCollection; + static Indexed: typeof IndexedCollection; + static Set: typeof SetCollection; + + static isCollection: typeof isCollection; + static isKeyed: typeof isKeyed; + static isIndexed: typeof isIndexed; + static isAssociative: typeof isAssociative; + static isOrdered: typeof isOrdered; +} + +declare class KeyedCollection extends Collection { + static ( + values?: Iterable<[K, V]> | PlainObjInput + ): KeyedCollection; + + toJS(): { [key: string]: mixed }; + toJSON(): { [key: string]: V }; + toArray(): Array<[K, V]>; + @@iterator(): Iterator<[K, V]>; + toSeq(): KeyedSeq; + flip(): KeyedCollection; + + concat( + ...iters: Array | PlainObjInput> + ): KeyedCollection; + + filter(predicate: typeof Boolean): KeyedCollection>; + filter( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): KeyedCollection; + + partition( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: V, key: K, iter: this) => M, + context?: mixed + ): KeyedCollection; + + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: mixed + ): KeyedCollection; + + mapEntries( + mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], + context?: mixed + ): KeyedCollection; + + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: mixed + ): KeyedCollection; + + flatten(depth?: number): KeyedCollection; + flatten(shallow?: boolean): KeyedCollection; +} + +Collection.Keyed = KeyedCollection; + +declare class IndexedCollection<+T> extends Collection { + static (iter?: Iterable): IndexedCollection; + + toJS(): Array; + toJSON(): Array; + toArray(): Array; + @@iterator(): Iterator; + toSeq(): IndexedSeq; + fromEntrySeq(): KeyedSeq; + interpose(separator: T): this; + interleave(...collections: Iterable[]): this; + splice(index: number, removeNum: number, ...values: T[]): this; + + zip(a: Iterable, ..._: []): IndexedCollection<[T, A]>; + zip( + a: Iterable, + b: Iterable, + ..._: [] + ): IndexedCollection<[T, A, B]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): IndexedCollection<[T, A, B, C]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): IndexedCollection<[T, A, B, C, D]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): IndexedCollection<[T, A, B, C, D, E]>; + + zipAll(a: Iterable, ..._: []): IndexedCollection<[T | void, A | void]>; + zipAll( + a: Iterable, + b: Iterable, + ..._: [] + ): IndexedCollection<[T | void, A | void, B | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): IndexedCollection<[T | void, A | void, B | void, C | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): IndexedCollection<[T | void, A | void, B | void, C | void, D | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): IndexedCollection< + [T | void, A | void, B | void, C | void, D | void, E | void], + >; + + zipWith( + zipper: (value: T, a: A) => R, + a: Iterable, + ..._: [] + ): IndexedCollection; + zipWith( + zipper: (value: T, a: A, b: B) => R, + a: Iterable, + b: Iterable, + ..._: [] + ): IndexedCollection; + zipWith( + zipper: (value: T, a: A, b: B, c: C) => R, + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): IndexedCollection; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): IndexedCollection; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): IndexedCollection; + + indexOf(searchValue: T): number; + lastIndexOf(searchValue: T): number; + findIndex( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): number; + findLastIndex( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): number; + + concat(...iters: Array | C>): IndexedCollection; + + filter(predicate: typeof Boolean): IndexedCollection<$NonMaybeType>; + filter( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): IndexedCollection; + + partition( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: T, index: number, iter: this) => M, + context?: mixed + ): IndexedCollection; + + flatMap( + mapper: (value: T, index: number, iter: this) => Iterable, + context?: mixed + ): IndexedCollection; + + flatten(depth?: number): IndexedCollection; + flatten(shallow?: boolean): IndexedCollection; +} + +declare class SetCollection<+T> extends Collection { + static (iter?: Iterable): SetCollection; + + toJS(): Array; + toJSON(): Array; + toArray(): Array; + @@iterator(): Iterator; + toSeq(): SetSeq; + + concat(...collections: Iterable[]): SetCollection; + + // `filter`, `map` and `flatMap` cannot be defined further up the hierarchy, + // because the implementation for `KeyedCollection` allows the value type to + // change without constraining the key type. That does not work for + // `SetCollection` - the value and key types *must* match. + filter(predicate: typeof Boolean): SetCollection<$NonMaybeType>; + filter( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): SetCollection; + + partition( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: T, value: T, iter: this) => M, + context?: mixed + ): SetCollection; + + flatMap( + mapper: (value: T, value: T, iter: this) => Iterable, + context?: mixed + ): SetCollection; + + flatten(depth?: number): SetCollection; + flatten(shallow?: boolean): SetCollection; +} + +declare function isSeq(maybeSeq: mixed): boolean %checks(maybeSeq instanceof + Seq); +declare class Seq extends _Collection { + static Keyed: typeof KeyedSeq; + static Indexed: typeof IndexedSeq; + static Set: typeof SetSeq; + + static (values: KeyedSeq): KeyedSeq; + static (values: SetSeq): SetSeq; + static (values: Iterable): IndexedSeq; + static (values?: PlainObjInput): KeyedSeq; + + static isSeq: typeof isSeq; + + size: number | void; + cacheResult(): this; + toSeq(): this; +} + +declare class KeyedSeq extends Seq mixins KeyedCollection { + static ( + values?: Iterable<[K, V]> | PlainObjInput + ): KeyedSeq; + + // Override specialized return types + flip(): KeyedSeq; + + concat( + ...iters: Array | PlainObjInput> + ): KeyedSeq; + + filter(predicate: typeof Boolean): KeyedSeq>; + filter( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): KeyedSeq; + + partition( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: V, key: K, iter: this) => M, + context?: mixed + ): KeyedSeq; + + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: mixed + ): KeyedSeq; + + mapEntries( + mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], + context?: mixed + ): KeyedSeq; + + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: mixed + ): KeyedSeq; + + flatten(depth?: number): KeyedSeq; + flatten(shallow?: boolean): KeyedSeq; +} + +declare class IndexedSeq<+T> + extends Seq + mixins IndexedCollection +{ + static (values?: Iterable): IndexedSeq; + + static of(...values: T[]): IndexedSeq; + + // Override specialized return types + + concat(...iters: Array | C>): IndexedSeq; + + filter(predicate: typeof Boolean): IndexedSeq<$NonMaybeType>; + filter( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): IndexedSeq; + + partition( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: T, index: number, iter: this) => M, + context?: mixed + ): IndexedSeq; + + flatMap( + mapper: (value: T, index: number, iter: this) => Iterable, + context?: mixed + ): IndexedSeq; + + flatten(depth?: number): IndexedSeq; + flatten(shallow?: boolean): IndexedSeq; + + zip(a: Iterable, ..._: []): IndexedSeq<[T, A]>; + zip(a: Iterable, b: Iterable, ..._: []): IndexedSeq<[T, A, B]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): IndexedSeq<[T, A, B, C]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): IndexedSeq<[T, A, B, C, D]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): IndexedSeq<[T, A, B, C, D, E]>; + + zipAll(a: Iterable, ..._: []): IndexedSeq<[T | void, A | void]>; + zipAll( + a: Iterable, + b: Iterable, + ..._: [] + ): IndexedSeq<[T | void, A | void, B | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): IndexedSeq<[T | void, A | void, B | void, C | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): IndexedSeq<[T | void, A | void, B | void, C | void, D | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): IndexedSeq<[T | void, A | void, B | void, C | void, D | void, E | void]>; + + zipWith( + zipper: (value: T, a: A) => R, + a: Iterable, + ..._: [] + ): IndexedSeq; + zipWith( + zipper: (value: T, a: A, b: B) => R, + a: Iterable, + b: Iterable, + ..._: [] + ): IndexedSeq; + zipWith( + zipper: (value: T, a: A, b: B, c: C) => R, + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): IndexedSeq; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): IndexedSeq; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): IndexedSeq; +} + +declare class SetSeq<+T> extends Seq mixins SetCollection { + static (values?: Iterable): SetSeq; + + static of(...values: T[]): SetSeq; + + // Override specialized return types + + concat(...collections: Iterable[]): SetSeq; + + filter(predicate: typeof Boolean): SetSeq<$NonMaybeType>; + filter( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): SetSeq; + + partition( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: T, value: T, iter: this) => M, + context?: mixed + ): SetSeq; + + flatMap( + mapper: (value: T, value: T, iter: this) => Iterable, + context?: mixed + ): SetSeq; + + flatten(depth?: number): SetSeq; + flatten(shallow?: boolean): SetSeq; +} + +declare class UpdatableInCollection { + setIn(keyPath: [], value: S): S; + setIn(keyPath: [K], value: V): this; + setIn, S: $ValOf>(keyPath: [K, K2], value: S): this; + setIn, K3: $KeyOf<$ValOf>, S: $ValOf<$ValOf, K3>>( + keyPath: [K, K2, K3], + value: S + ): this; + setIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + S: $ValOf<$ValOf<$ValOf, K3>, K4>, + >( + keyPath: [K, K2, K3, K4], + value: S + ): this; + setIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5>, + >( + keyPath: [K, K2, K3, K4, K5], + value: S + ): this; + + deleteIn(keyPath: []): void; + deleteIn(keyPath: [K]): this; + deleteIn>(keyPath: [K, K2]): this; + deleteIn, K3: $KeyOf<$ValOf>>( + keyPath: [K, K2, K3] + ): this; + deleteIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + >( + keyPath: [K, K2, K3, K4] + ): this; + deleteIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, + >( + keyPath: [K, K2, K3, K4, K5] + ): this; + + removeIn(keyPath: []): void; + removeIn(keyPath: [K]): this; + removeIn>(keyPath: [K, K2]): this; + removeIn, K3: $KeyOf<$ValOf>>( + keyPath: [K, K2, K3] + ): this; + removeIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + >( + keyPath: [K, K2, K3, K4] + ): this; + removeIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, + >( + keyPath: [K, K2, K3, K4, K5] + ): this; + + updateIn(keyPath: [], notSetValue: mixed, updater: (value: this) => U): U; + updateIn(keyPath: [], updater: (value: this) => U): U; + updateIn(keyPath: [K], notSetValue: NSV, updater: (value: V) => V): this; + updateIn(keyPath: [K], updater: (value: V) => V): this; + updateIn, S: $ValOf>( + keyPath: [K, K2], + notSetValue: NSV, + updater: (value: $ValOf | NSV) => S + ): this; + updateIn, S: $ValOf>( + keyPath: [K, K2], + updater: (value: $ValOf) => S + ): this; + updateIn< + NSV, + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + S: $ValOf<$ValOf, K3>, + >( + keyPath: [K, K2, K3], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf, K3> | NSV) => S + ): this; + updateIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + S: $ValOf<$ValOf, K3>, + >( + keyPath: [K, K2, K3], + updater: (value: $ValOf<$ValOf, K3>) => S + ): this; + updateIn< + NSV, + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + S: $ValOf<$ValOf<$ValOf, K3>, K4>, + >( + keyPath: [K, K2, K3, K4], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf<$ValOf, K3>, K4> | NSV) => S + ): this; + updateIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + S: $ValOf<$ValOf<$ValOf, K3>, K4>, + >( + keyPath: [K, K2, K3, K4], + updater: (value: $ValOf<$ValOf<$ValOf, K3>, K4>) => S + ): this; + updateIn< + NSV, + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5>, + >( + keyPath: [K, K2, K3, K4, K5], + notSetValue: NSV, + updater: ( + value: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5> | NSV + ) => S + ): this; + updateIn< + K2: $KeyOf, + K3: $KeyOf<$ValOf>, + K4: $KeyOf<$ValOf<$ValOf, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5>, + >( + keyPath: [K, K2, K3, K4, K5], + updater: (value: $ValOf<$ValOf<$ValOf<$ValOf, K3>, K4>, K5>) => S + ): this; +} + +declare function isList(maybeList: mixed): boolean %checks(maybeList instanceof + List); +declare class List<+T> + extends IndexedCollection + mixins UpdatableInCollection +{ + static (collection?: Iterable): List; + + static of(...values: T[]): List; + + static isList: typeof isList; + + size: number; + + set(index: number, value: U): List; + delete(index: number): this; + remove(index: number): this; + insert(index: number, value: U): List; + clear(): this; + push(...values: U[]): List; + pop(): this; + unshift(...values: U[]): List; + shift(): this; + + update(updater: (value: this) => U): U; + update(index: number, updater: (value: T) => U): List; + update( + index: number, + notSetValue: U, + updater: (value: T) => U + ): List; + + merge(...collections: Iterable[]): List; + + setSize(size: number): this; + + mergeIn(keyPath: Iterable, ...collections: Iterable[]): this; + mergeDeepIn( + keyPath: Iterable, + ...collections: Iterable[] + ): this; + + withMutations(mutator: (mutable: this) => mixed): this; + asMutable(): this; + wasAltered(): boolean; + asImmutable(): this; + + // Override specialized return types + + concat(...iters: Array | C>): List; + + filter(predicate: typeof Boolean): List<$NonMaybeType>; + filter( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): List; + + partition( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: T, index: number, iter: this) => M, + context?: mixed + ): List; + + flatMap( + mapper: (value: T, index: number, iter: this) => Iterable, + context?: mixed + ): List; + + flatten(depth?: number): List; + flatten(shallow?: boolean): List; + + zip(a: Iterable, ..._: []): List<[T, A]>; + zip(a: Iterable, b: Iterable, ..._: []): List<[T, A, B]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): List<[T, A, B, C]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): List<[T, A, B, C, D]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): List<[T, A, B, C, D, E]>; + + zipAll(a: Iterable, ..._: []): List<[T | void, A | void]>; + zipAll( + a: Iterable, + b: Iterable, + ..._: [] + ): List<[T | void, A | void, B | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): List<[T | void, A | void, B | void, C | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): List<[T | void, A | void, B | void, C | void, D | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): List<[T | void, A | void, B | void, C | void, D | void, E | void]>; + + zipWith( + zipper: (value: T, a: A) => R, + a: Iterable, + ..._: [] + ): List; + zipWith( + zipper: (value: T, a: A, b: B) => R, + a: Iterable, + b: Iterable, + ..._: [] + ): List; + zipWith( + zipper: (value: T, a: A, b: B, c: C) => R, + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): List; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): List; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): List; +} + +declare function isMap(maybeMap: mixed): boolean %checks(maybeMap instanceof + Map); +declare class Map + extends KeyedCollection + mixins UpdatableInCollection +{ + static (values?: Iterable<[K, V]> | PlainObjInput): Map; + + static isMap: typeof isMap; + + size: number; + + set(key: K_, value: V_): Map; + delete(key: K): this; + remove(key: K): this; + clear(): this; + + deleteAll(keys: Iterable): Map; + removeAll(keys: Iterable): Map; + + update(updater: (value: this) => U): U; + update(key: K, updater: (value: V) => V_): Map; + update( + key: K, + notSetValue: V_, + updater: (value: V) => V_ + ): Map; + + merge( + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): Map; + concat( + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): Map; + + mergeWith( + merger: (oldVal: V, newVal: W, key: K) => X, + ...collections: (Iterable<[K_, W]> | PlainObjInput)[] + ): Map; + + mergeDeep( + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): Map; + + mergeDeepWith( + merger: (oldVal: any, newVal: any, key: any) => mixed, + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): Map; + + mergeIn( + keyPath: Iterable, + ...collections: (Iterable | PlainObjInput)[] + ): this; + mergeDeepIn( + keyPath: Iterable, + ...collections: (Iterable | PlainObjInput)[] + ): this; + + withMutations(mutator: (mutable: this) => mixed): this; + asMutable(): this; + wasAltered(): boolean; + asImmutable(): this; + + // Override specialized return types + + flip(): Map; + + filter(predicate: typeof Boolean): Map>; + filter( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): Map; + + partition( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: V, key: K, iter: this) => M, + context?: mixed + ): Map; + + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: mixed + ): Map; + + mapEntries( + mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], + context?: mixed + ): Map; + + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: mixed + ): Map; + + flatten(depth?: number): Map; + flatten(shallow?: boolean): Map; +} + +declare function isOrderedMap( + maybeOrderedMap: mixed +): boolean %checks(maybeOrderedMap instanceof OrderedMap); +declare class OrderedMap + extends Map + mixins UpdatableInCollection +{ + static ( + values?: Iterable<[K, V]> | PlainObjInput + ): OrderedMap; + + static isOrderedMap: typeof isOrderedMap; + + size: number; + + set(key: K_, value: V_): OrderedMap; + delete(key: K): this; + remove(key: K): this; + clear(): this; + + update(updater: (value: this) => U): U; + update(key: K, updater: (value: V) => V_): OrderedMap; + update( + key: K, + notSetValue: V_, + updater: (value: V) => V_ + ): OrderedMap; + + merge( + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): OrderedMap; + concat( + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): OrderedMap; + + mergeWith( + merger: (oldVal: V, newVal: W, key: K) => X, + ...collections: (Iterable<[K_, W]> | PlainObjInput)[] + ): OrderedMap; + + mergeDeep( + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): OrderedMap; + + mergeDeepWith( + merger: (oldVal: any, newVal: any, key: any) => mixed, + ...collections: (Iterable<[K_, V_]> | PlainObjInput)[] + ): OrderedMap; + + mergeIn( + keyPath: Iterable, + ...collections: (Iterable | PlainObjInput)[] + ): this; + mergeDeepIn( + keyPath: Iterable, + ...collections: (Iterable | PlainObjInput)[] + ): this; + + withMutations(mutator: (mutable: this) => mixed): this; + asMutable(): this; + wasAltered(): boolean; + asImmutable(): this; + + // Override specialized return types + + flip(): OrderedMap; + + filter(predicate: typeof Boolean): OrderedMap>; + filter( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): OrderedMap; + + partition( + predicate: (value: V, key: K, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: V, key: K, iter: this) => M, + context?: mixed + ): OrderedMap; + + mapKeys( + mapper: (key: K, value: V, iter: this) => M, + context?: mixed + ): OrderedMap; + + mapEntries( + mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], + context?: mixed + ): OrderedMap; + + flatMap( + mapper: (value: V, key: K, iter: this) => Iterable<[KM, VM]>, + context?: mixed + ): OrderedMap; + + flatten(depth?: number): OrderedMap; + flatten(shallow?: boolean): OrderedMap; +} + +declare function isSet(maybeSet: mixed): boolean %checks(maybeSet instanceof + Set); +declare class Set<+T> extends SetCollection { + static (values?: Iterable): Set; + + static of(...values: T[]): Set; + static fromKeys( + values: Iterable<[T, mixed]> | PlainObjInput + ): Set; + + static intersect(sets: Iterable>): Set; + static union(sets: Iterable>): Set; + + static isSet: typeof isSet; + + size: number; + + add(value: U): Set; + delete(value: T): this; + remove(value: T): this; + clear(): this; + union(...collections: Iterable[]): Set; + merge(...collections: Iterable[]): Set; + concat(...collections: Iterable[]): Set; + intersect(...collections: Iterable[]): Set; + subtract(...collections: Iterable[]): this; + + withMutations(mutator: (mutable: this) => mixed): this; + asMutable(): this; + wasAltered(): boolean; + asImmutable(): this; + + // Override specialized return types + + filter(predicate: typeof Boolean): Set<$NonMaybeType>; + filter( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): Set; + + partition( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: T, value: T, iter: this) => M, + context?: mixed + ): Set; + + flatMap( + mapper: (value: T, value: T, iter: this) => Iterable, + context?: mixed + ): Set; + + flatten(depth?: number): Set; + flatten(shallow?: boolean): Set; +} + +// Overrides except for `isOrderedSet` are for specialized return types +declare function isOrderedSet( + maybeOrderedSet: mixed +): boolean %checks(maybeOrderedSet instanceof OrderedSet); +declare class OrderedSet<+T> extends Set { + static (values?: Iterable): OrderedSet; + + static of(...values: T[]): OrderedSet; + static fromKeys( + values: Iterable<[T, mixed]> | PlainObjInput + ): OrderedSet; + + static isOrderedSet: typeof isOrderedSet; + + size: number; + + add(value: U): OrderedSet; + union(...collections: Iterable[]): OrderedSet; + merge(...collections: Iterable[]): OrderedSet; + concat(...collections: Iterable[]): OrderedSet; + intersect(...collections: Iterable[]): OrderedSet; + + filter(predicate: typeof Boolean): OrderedSet<$NonMaybeType>; + filter( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): OrderedSet; + + partition( + predicate: (value: T, value: T, iter: this) => mixed, + context?: mixed + ): [this, this]; + + map( + mapper: (value: T, value: T, iter: this) => M, + context?: mixed + ): OrderedSet; + + flatMap( + mapper: (value: T, value: T, iter: this) => Iterable, + context?: mixed + ): OrderedSet; + + flatten(depth?: number): OrderedSet; + flatten(shallow?: boolean): OrderedSet; + + zip(a: Iterable, ..._: []): OrderedSet<[T, A]>; + zip(a: Iterable, b: Iterable, ..._: []): OrderedSet<[T, A, B]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): OrderedSet<[T, A, B, C]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): OrderedSet<[T, A, B, C, D]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): OrderedSet<[T, A, B, C, D, E]>; + + zipAll(a: Iterable, ..._: []): OrderedSet<[T | void, A | void]>; + zipAll( + a: Iterable, + b: Iterable, + ..._: [] + ): OrderedSet<[T | void, A | void, B | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): OrderedSet<[T | void, A | void, B | void, C | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): OrderedSet<[T | void, A | void, B | void, C | void, D | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): OrderedSet<[T | void, A | void, B | void, C | void, D | void, E | void]>; + + zipWith( + zipper: (value: T, a: A) => R, + a: Iterable, + ..._: [] + ): OrderedSet; + zipWith( + zipper: (value: T, a: A, b: B) => R, + a: Iterable, + b: Iterable, + ..._: [] + ): OrderedSet; + zipWith( + zipper: (value: T, a: A, b: B, c: C) => R, + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): OrderedSet; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): OrderedSet; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): OrderedSet; +} + +declare function isStack( + maybeStack: mixed +): boolean %checks(maybeStack instanceof Stack); +declare class Stack<+T> extends IndexedCollection { + static (collection?: Iterable): Stack; + + static isStack(maybeStack: mixed): boolean; + static of(...values: T[]): Stack; + + static isStack: typeof isStack; + + size: number; + + peek(): T; + clear(): this; + unshift(...values: U[]): Stack; + unshiftAll(iter: Iterable): Stack; + shift(): this; + push(...values: U[]): Stack; + pushAll(iter: Iterable): Stack; + pop(): this; + + withMutations(mutator: (mutable: this) => mixed): this; + asMutable(): this; + wasAltered(): boolean; + asImmutable(): this; + + // Override specialized return types + + concat(...iters: Array | C>): Stack; + + filter(predicate: typeof Boolean): Stack<$NonMaybeType>; + filter( + predicate: (value: T, index: number, iter: this) => mixed, + context?: mixed + ): Stack; + + map( + mapper: (value: T, index: number, iter: this) => M, + context?: mixed + ): Stack; + + flatMap( + mapper: (value: T, index: number, iter: this) => Iterable, + context?: mixed + ): Stack; + + flatten(depth?: number): Stack; + flatten(shallow?: boolean): Stack; + + zip(a: Iterable, ..._: []): Stack<[T, A]>; + zip(a: Iterable, b: Iterable, ..._: []): Stack<[T, A, B]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): Stack<[T, A, B, C]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): Stack<[T, A, B, C, D]>; + zip( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): Stack<[T, A, B, C, D, E]>; + + zipAll(a: Iterable, ..._: []): Stack<[T | void, A | void]>; + zipAll( + a: Iterable, + b: Iterable, + ..._: [] + ): Stack<[T | void, A | void, B | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): Stack<[T | void, A | void, B | void, C | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): Stack<[T | void, A | void, B | void, C | void, D | void]>; + zipAll( + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): Stack<[T | void, A | void, B | void, C | void, D | void, E | void]>; + + zipWith( + zipper: (value: T, a: A) => R, + a: Iterable, + ..._: [] + ): Stack; + zipWith( + zipper: (value: T, a: A, b: B) => R, + a: Iterable, + b: Iterable, + ..._: [] + ): Stack; + zipWith( + zipper: (value: T, a: A, b: B, c: C) => R, + a: Iterable, + b: Iterable, + c: Iterable, + ..._: [] + ): Stack; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + ..._: [] + ): Stack; + zipWith( + zipper: (value: T, a: A, b: B, c: C, d: D, e: E) => R, + a: Iterable, + b: Iterable, + c: Iterable, + d: Iterable, + e: Iterable, + ..._: [] + ): Stack; +} + +declare function Range( + start?: number, + end?: number, + step?: number +): IndexedSeq; +declare function Repeat(value: T, times?: number): IndexedSeq; + +// The type of a Record factory function. +type RecordFactory = Class>; + +// The type of runtime Record instances. +type RecordOf = RecordInstance & $ReadOnly; + +// The values of a Record instance. +type _RecordValues | T> = R; +type RecordValues = _RecordValues<*, R>; + +declare function isRecord( + maybeRecord: any +): boolean %checks(maybeRecord instanceof RecordInstance); +declare class Record { + static (spec: Values, name?: string): typeof RecordInstance; + constructor( + spec: Values, + name?: string + ): typeof RecordInstance; + + static isRecord: typeof isRecord; + + static getDescriptiveName(record: RecordInstance): string; +} + +declare class RecordInstance { + static (values?: Iterable<[$Keys, $ValOf]> | $Shape): RecordOf; + // Note: a constructor can only create an instance of RecordInstance, + // it's encouraged to not use `new` when creating Records. + constructor(values?: Iterable<[$Keys, $ValOf]> | $Shape): void; + + size: number; + + has(key: string): boolean; + + get>(key: K, ..._: []): $ElementType; + get, NSV>(key: K, notSetValue: NSV): $ElementType | NSV; + + hasIn(keyPath: Iterable): boolean; + + getIn(keyPath: [], notSetValue?: mixed): this & $ReadOnly; + getIn>(keyPath: [K], notSetValue?: mixed): $ElementType; + getIn, K2: $KeyOf<$ValOf>>( + keyPath: [K, K2], + notSetValue: NSV + ): $ValOf<$ValOf, K2> | NSV; + getIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + >( + keyPath: [K, K2, K3], + notSetValue: NSV + ): $ValOf<$ValOf<$ValOf, K2>, K3> | NSV; + getIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + >( + keyPath: [K, K2, K3, K4], + notSetValue: NSV + ): $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> | NSV; + getIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + >( + keyPath: [K, K2, K3, K4, K5], + notSetValue: NSV + ): $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> | NSV; + + equals(other: any): boolean; + hashCode(): number; + + set>(key: K, value: $ElementType): this & $ReadOnly; + update>( + key: K, + updater: (value: $ElementType) => $ElementType + ): this & $ReadOnly; + merge( + ...collections: Array, $ValOf]> | $Shape> + ): this & $ReadOnly; + mergeDeep( + ...collections: Array, $ValOf]> | $Shape> + ): this & $ReadOnly; + + mergeWith( + merger: (oldVal: $ValOf, newVal: $ValOf, key: $Keys) => $ValOf, + ...collections: Array, $ValOf]> | $Shape> + ): this & $ReadOnly; + mergeDeepWith( + merger: (oldVal: any, newVal: any, key: any) => any, + ...collections: Array, $ValOf]> | $Shape> + ): this & $ReadOnly; + + delete>(key: K): this & $ReadOnly; + remove>(key: K): this & $ReadOnly; + clear(): this & $ReadOnly; + + setIn(keyPath: [], value: S): S; + setIn, S: $ValOf>( + keyPath: [K], + value: S + ): this & $ReadOnly; + setIn, K2: $KeyOf<$ValOf>, S: $ValOf<$ValOf, K2>>( + keyPath: [K, K2], + value: S + ): this & $ReadOnly; + setIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + S: $ValOf<$ValOf<$ValOf, K2>, K3>, + >( + keyPath: [K, K2, K3], + value: S + ): this & $ReadOnly; + setIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, + >( + keyPath: [K, K2, K3, K4], + value: S + ): this & $ReadOnly; + setIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5>, + >( + keyPath: [K, K2, K3, K4, K5], + value: S + ): this & $ReadOnly; + + deleteIn(keyPath: []): void; + deleteIn>(keyPath: [K]): this & $ReadOnly; + deleteIn, K2: $KeyOf<$ValOf>>( + keyPath: [K, K2] + ): this & $ReadOnly; + deleteIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + >( + keyPath: [K, K2, K3] + ): this & $ReadOnly; + deleteIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + >( + keyPath: [K, K2, K3, K4] + ): this & $ReadOnly; + deleteIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + >( + keyPath: [K, K2, K3, K4, K5] + ): this & $ReadOnly; + + removeIn(keyPath: []): void; + removeIn>(keyPath: [K]): this & $ReadOnly; + removeIn, K2: $KeyOf<$ValOf>>( + keyPath: [K, K2] + ): this & $ReadOnly; + removeIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + >( + keyPath: [K, K2, K3] + ): this & $ReadOnly; + removeIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + >( + keyPath: [K, K2, K3, K4] + ): this & $ReadOnly; + removeIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + >( + keyPath: [K, K2, K3, K4, K5] + ): this & $ReadOnly; + + updateIn( + keyPath: [], + notSetValue: mixed, + updater: (value: this & T) => U + ): U; + updateIn(keyPath: [], updater: (value: this & T) => U): U; + updateIn, S: $ValOf>( + keyPath: [K], + notSetValue: NSV, + updater: (value: $ValOf) => S + ): this & $ReadOnly; + updateIn, S: $ValOf>( + keyPath: [K], + updater: (value: $ValOf) => S + ): this & $ReadOnly; + updateIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + S: $ValOf<$ValOf, K2>, + >( + keyPath: [K, K2], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf, K2> | NSV) => S + ): this & $ReadOnly; + updateIn, K2: $KeyOf<$ValOf>, S: $ValOf<$ValOf, K2>>( + keyPath: [K, K2], + updater: (value: $ValOf<$ValOf, K2>) => S + ): this & $ReadOnly; + updateIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + S: $ValOf<$ValOf<$ValOf, K2>, K3>, + >( + keyPath: [K, K2, K3], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf<$ValOf, K2>, K3> | NSV) => S + ): this & $ReadOnly; + updateIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + S: $ValOf<$ValOf<$ValOf, K2>, K3>, + >( + keyPath: [K, K2, K3], + updater: (value: $ValOf<$ValOf<$ValOf, K2>, K3>) => S + ): this & $ReadOnly; + updateIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, + >( + keyPath: [K, K2, K3, K4], + notSetValue: NSV, + updater: ( + value: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> | NSV + ) => S + ): this & $ReadOnly; + updateIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, + >( + keyPath: [K, K2, K3, K4], + updater: (value: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>) => S + ): this & $ReadOnly; + updateIn< + NSV, + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5>, + >( + keyPath: [K, K2, K3, K4, K5], + notSetValue: NSV, + updater: ( + value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> | NSV + ) => S + ): this & $ReadOnly; + updateIn< + K: $Keys, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5>, + >( + keyPath: [K, K2, K3, K4, K5], + updater: ( + value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> + ) => S + ): this & $ReadOnly; + + mergeIn( + keyPath: Iterable, + ...collections: Array + ): this & $ReadOnly; + mergeDeepIn( + keyPath: Iterable, + ...collections: Array + ): this & $ReadOnly; + + toSeq(): KeyedSeq<$Keys, any>; + + toJS(): { [key: $Keys]: mixed }; + toJSON(): T; + toObject(): T; + + withMutations(mutator: (mutable: this & T) => mixed): this & $ReadOnly; + asMutable(): this & $ReadOnly; + wasAltered(): boolean; + asImmutable(): this & $ReadOnly; + + @@iterator(): Iterator<[$Keys, $ValOf]>; +} + +declare function fromJS( + jsValue: mixed, + reviver?: ( + key: string | number, + sequence: KeyedCollection | IndexedCollection, + path?: Array + ) => mixed +): Collection; + +declare function is(first: mixed, second: mixed): boolean; +declare function hash(value: mixed): number; + +declare function get>( + collection: C, + key: K, + notSetValue: mixed +): $ValOf; +declare function get, NSV>( + collection: C, + key: K, + notSetValue: NSV +): $ValOf | NSV; + +declare function has(collection: Object, key: mixed): boolean; +declare function remove(collection: C, key: $KeyOf): C; +declare function set, V: $ValOf>( + collection: C, + key: K, + value: V +): C; +declare function update, V: $ValOf, NSV>( + collection: C, + key: K, + notSetValue: NSV, + updater: ($ValOf | NSV) => V +): C; +declare function update, V: $ValOf>( + collection: C, + key: K, + updater: ($ValOf) => V +): C; + +declare function getIn(collection: C, keyPath: [], notSetValue?: mixed): C; +declare function getIn, NSV>( + collection: C, + keyPath: [K], + notSetValue: NSV +): $ValOf | NSV; +declare function getIn, K2: $KeyOf<$ValOf>, NSV>( + collection: C, + keyPath: [K, K2], + notSetValue: NSV +): $ValOf<$ValOf, K2> | NSV; +declare function getIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + NSV, +>( + collection: C, + keyPath: [K, K2, K3], + notSetValue: NSV +): $ValOf<$ValOf<$ValOf, K2>, K3> | NSV; +declare function getIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + NSV, +>( + collection: C, + keyPath: [K, K2, K3, K4], + notSetValue: NSV +): $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> | NSV; +declare function getIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + NSV, +>( + collection: C, + keyPath: [K, K2, K3, K4, K5], + notSetValue: NSV +): $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> | NSV; + +declare function hasIn(collection: Object, keyPath: Iterable): boolean; + +declare function removeIn(collection: C, keyPath: []): void; +declare function removeIn>(collection: C, keyPath: [K]): C; +declare function removeIn, K2: $KeyOf<$ValOf>>( + collection: C, + keyPath: [K, K2] +): C; +declare function removeIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, +>( + collection: C, + keyPath: [K, K2, K3] +): C; +declare function removeIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, +>( + collection: C, + keyPath: [K, K2, K3, K4] +): C; +declare function removeIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, +>( + collection: C, + keyPath: [K, K2, K3, K4, K5] +): C; + +declare function setIn(collection: Object, keyPath: [], value: S): S; +declare function setIn, S: $ValOf>( + collection: C, + keyPath: [K], + value: S +): C; +declare function setIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + S: $ValOf<$ValOf, K2>, +>( + collection: C, + keyPath: [K, K2], + value: S +): C; +declare function setIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + S: $ValOf<$ValOf<$ValOf, K2>, K3>, +>( + collection: C, + keyPath: [K, K2, K3], + value: S +): C; +declare function setIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, +>( + collection: C, + keyPath: [K, K2, K3, K4], + value: S +): C; +declare function setIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5>, +>( + collection: C, + keyPath: [K, K2, K3, K4, K5], + value: S +): C; + +declare function updateIn( + collection: C, + keyPath: [], + notSetValue: mixed, + updater: (value: C) => S +): S; +declare function updateIn( + collection: C, + keyPath: [], + updater: (value: C) => S +): S; +declare function updateIn, S: $ValOf, NSV>( + collection: C, + keyPath: [K], + notSetValue: NSV, + updater: (value: $ValOf | NSV) => S +): C; +declare function updateIn, S: $ValOf>( + collection: C, + keyPath: [K], + updater: (value: $ValOf) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + S: $ValOf<$ValOf, K2>, + NSV, +>( + collection: C, + keyPath: [K, K2], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf, K2> | NSV) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + S: $ValOf<$ValOf, K2>, +>( + collection: C, + keyPath: [K, K2], + updater: (value: $ValOf<$ValOf, K2>) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + S: $ValOf<$ValOf<$ValOf, K2>, K3>, + NSV, +>( + collection: C, + keyPath: [K, K2, K3], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf<$ValOf, K2>, K3> | NSV) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + S: $ValOf<$ValOf<$ValOf, K2>, K3>, +>( + collection: C, + keyPath: [K, K2, K3], + updater: (value: $ValOf<$ValOf<$ValOf, K2>, K3>) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, + NSV, +>( + collection: C, + keyPath: [K, K2, K3, K4], + notSetValue: NSV, + updater: (value: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4> | NSV) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + S: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, +>( + collection: C, + keyPath: [K, K2, K3, K4], + updater: (value: $ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5>, + NSV, +>( + collection: C, + keyPath: [K, K2, K3, K4, K5], + notSetValue: NSV, + updater: ( + value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> | NSV + ) => S +): C; +declare function updateIn< + C, + K: $KeyOf, + K2: $KeyOf<$ValOf>, + K3: $KeyOf<$ValOf<$ValOf, K2>>, + K4: $KeyOf<$ValOf<$ValOf<$ValOf, K2>, K3>>, + K5: $KeyOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>>, + S: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5>, +>( + collection: C, + keyPath: [K, K2, K3, K4, K5], + updater: ( + value: $ValOf<$ValOf<$ValOf<$ValOf<$ValOf, K2>, K3>, K4>, K5> + ) => S +): C; + +declare function merge( + collection: C, + ...collections: Array< + | $IterableOf + | $Shape> + | PlainObjInput<$KeyOf, $ValOf>, + > +): C; +declare function mergeWith( + merger: (oldVal: $ValOf, newVal: $ValOf, key: $KeyOf) => $ValOf, + collection: C, + ...collections: Array< + | $IterableOf + | $Shape> + | PlainObjInput<$KeyOf, $ValOf>, + > +): C; +declare function mergeDeep( + collection: C, + ...collections: Array< + | $IterableOf + | $Shape> + | PlainObjInput<$KeyOf, $ValOf>, + > +): C; +declare function mergeDeepWith( + merger: (oldVal: any, newVal: any, key: any) => mixed, + collection: C, + ...collections: Array< + | $IterableOf + | $Shape> + | PlainObjInput<$KeyOf, $ValOf>, + > +): C; + +export { + Collection, + Seq, + List, + Map, + OrderedMap, + OrderedSet, + Range, + Repeat, + Record, + Set, + Stack, + fromJS, + is, + hash, + isImmutable, + isCollection, + isKeyed, + isIndexed, + isAssociative, + isOrdered, + isRecord, + isValueObject, + get, + has, + remove, + set, + update, + getIn, + hasIn, + removeIn, + setIn, + updateIn, + merge, + mergeWith, + mergeDeep, + mergeDeepWith, +}; + +export default { + Collection, + Seq, + + List, + Map, + OrderedMap, + OrderedSet, + PairSorting, + Range, + Repeat, + Record, + Set, + Stack, + + fromJS, + is, + hash, + + isImmutable, + isCollection, + isKeyed, + isIndexed, + isAssociative, + isOrdered, + isRecord, + isValueObject, + + get, + has, + remove, + set, + update, + getIn, + hasIn, + removeIn, + setIn, + updateIn, + merge, + mergeWith, + mergeDeep, + mergeDeepWith, +}; + +export type { + Comparator, + KeyedCollection, + IndexedCollection, + SetCollection, + KeyedSeq, + IndexedSeq, + SetSeq, + RecordFactory, + RecordOf, + RecordInstance, + ValueObject, + $KeyOf, + $ValOf, +}; diff --git a/type-definitions/ts-tests/covariance.ts b/type-definitions/ts-tests/covariance.ts new file mode 100644 index 0000000000..b4c01e50e9 --- /dev/null +++ b/type-definitions/ts-tests/covariance.ts @@ -0,0 +1,87 @@ +import { expect, test } from 'tstyche'; +import { + List, + Map, + MapOf, + OrderedMap, + OrderedSet, + Set, + Stack, +} from 'immutable'; + +class A { + x: number; + + constructor() { + this.x = 1; + } +} + +class B extends A { + y: string; + + constructor() { + super(); + this.y = 'B'; + } +} + +class C { + z: string; + + constructor() { + this.z = 'C'; + } +} + +test('List covariance', () => { + expect>().type.toBeAssignableWith(List()); + + expect(List([new B()])).type.toBe>(); + + expect>().type.not.toBeAssignableWith(List()); +}); + +test('Map covariance', () => { + expect>().type.toBeAssignableWith>(); + + expect(Map({ b: new B() })).type.toBe>(); + + expect>().type.not.toBeAssignableWith>(); +}); + +test('Set covariance', () => { + expect>().type.toBeAssignableWith>(); + + expect(Set([new B()])).type.toBe>(); + + expect>().type.not.toBeAssignableWith>(); +}); + +test('Stack covariance', () => { + expect>().type.toBeAssignableWith>(); + + expect(Stack([new B()])).type.toBe>(); + + expect>().type.not.toBeAssignableWith>(); +}); + +test('OrderedMap covariance', () => { + expect>().type.toBeAssignableWith< + OrderedMap + >(); + + expect(OrderedMap({ b: new B() })).type.toBe>(); + + expect>().type.not.toBeAssignableWith< + OrderedMap + >(); +}); + +test('OrderedSet covariance', () => { + expect>().type.toBeAssignableWith>(); + + expect(OrderedSet([new B()])).type.toBe>(); + + expect>().type.not.toBeAssignableWith>(); +}); diff --git a/type-definitions/ts-tests/deepCopy.ts b/type-definitions/ts-tests/deepCopy.ts new file mode 100644 index 0000000000..25e262fd81 --- /dev/null +++ b/type-definitions/ts-tests/deepCopy.ts @@ -0,0 +1,112 @@ +import { describe, expect, test } from 'tstyche'; +import { List, Map, Record, Set, Seq, DeepCopy, Collection } from 'immutable'; + +describe('DeepCopy', () => { + test('basic types', () => { + expect< + DeepCopy<{ + a: number; + b: number; + }> + >().type.toBe<{ + a: number; + b: number; + }>(); + }); + + test('iterables', () => { + expect>().type.toBe(); + + expect>>().type.toBe(); + }); + + test('immutable first-level types', () => { + expect>>().type.toBe<{ + [x: string]: string; + }>(); + + // should be `{ [x: string]: object }`, but there is an issue with circular references + expect>>().type.toBe<{ + [x: string]: unknown; + }>(); + + // should be `{ [x: string]: object; [x: number]: object }`, but there is an issue with circular references + expect>>().type.toBe<{ + [x: string]: unknown; + [x: number]: unknown; + }>(); + + expect>>().type.toBe(); + + expect>>().type.toBe(); + }); + + test('keyed', () => { + expect>>().type.toBe<{ + [x: string]: number; + }>(); + + expect>>().type.toBe<{ + [x: string]: number; + [x: number]: number; + }>(); + + expect>>().type.toBe<{ + [x: string]: number; + [x: number]: number; + }>(); + + expect>>().type.toBe<{ + [x: string]: number; + [x: number]: number; + }>(); + }); + + test('nested', () => { + // should be `{ map: { [x: string]: string }; list: string[]; set: string[] }`, but there is an issue with circular references + expect< + DeepCopy<{ + map: Map; + list: List; + set: Set; + }> + >().type.toBe<{ map: unknown; list: unknown; set: unknown }>(); + + // should be `{ map: { [x: string]: string } }`, but there is an issue with circular references + expect>>>().type.toBe<{ + map: unknown; + }>(); + }); + + test('circular references', () => { + type Article = Record<{ title: string; tag: Tag }>; + type Tag = Record<{ name: string; article: Article }>; + + // should handle circular references here somehow + expect>().type.toBe<{ title: string; tag: unknown }>(); + }); + + test('circular references #1957', () => { + class Foo1 extends Record<{ foo: undefined | Foo1 }>({ + foo: undefined, + }) {} + + class Foo2 extends Record<{ foo?: Foo2 }>({ + foo: undefined, + }) {} + + class Foo3 extends Record<{ foo: null | Foo3 }>({ + foo: null, + }) {} + + expect>().type.toBe<{ foo: unknown }>(); + expect>().type.toBe<{ foo?: unknown }>(); + expect>().type.toBe<{ foo: unknown }>(); + + class FooWithList extends Record<{ foo: undefined | List }>({ + foo: undefined, + }) {} + + expect>().type.toBe<{ foo: unknown }>(); + }); +}); diff --git a/type-definitions/ts-tests/empty.ts b/type-definitions/ts-tests/empty.ts new file mode 100644 index 0000000000..e9425c6eb5 --- /dev/null +++ b/type-definitions/ts-tests/empty.ts @@ -0,0 +1,40 @@ +import { expect, test } from 'tstyche'; +import { Seq, Collection } from 'immutable'; + +test('typed empty Seq', () => { + expect(Seq()).type.toBe>(); + + expect(Seq()).type.toBe>(); + + expect(Seq.Indexed()).type.toBe>(); + + expect(Seq.Indexed()).type.toBe>(); + + expect(Seq.Keyed()).type.toBe>(); + + expect(Seq.Keyed()).type.toBe>(); + + expect(Seq.Set()).type.toBe>(); + + expect(Seq.Set()).type.toBe>(); +}); + +test('typed empty Collection', () => { + expect(Collection()).type.toBe>(); + + expect(Collection()).type.toBe>(); + + expect(Collection.Indexed()).type.toBe>(); + + expect(Collection.Indexed()).type.toBe>(); + + expect(Collection.Keyed()).type.toBe>(); + + expect(Collection.Keyed()).type.toBe< + Collection.Keyed + >(); + + expect(Collection.Set()).type.toBe>(); + + expect(Collection.Set()).type.toBe>(); +}); diff --git a/type-definitions/ts-tests/es6-collections.ts b/type-definitions/ts-tests/es6-collections.ts new file mode 100644 index 0000000000..790bc3cf2b --- /dev/null +++ b/type-definitions/ts-tests/es6-collections.ts @@ -0,0 +1,21 @@ +import { expect, test } from 'tstyche'; +import { Map as ImmutableMap, Set as ImmutableSet } from 'immutable'; + +test('immutable.js collections', () => { + const mapImmutable: ImmutableMap = ImmutableMap< + string, + number + >(); + const setImmutable: ImmutableSet = ImmutableSet(); + + expect(mapImmutable.delete('foo')).type.toBe>(); + expect(setImmutable.delete('bar')).type.toBe>(); +}); + +test('ES6 collections', () => { + const mapES6: Map = new Map(); + const setES6: Set = new Set(); + + expect(mapES6.delete('foo')).type.toBe(); + expect(setES6.delete('bar')).type.toBe(); +}); diff --git a/type-definitions/ts-tests/exports.ts b/type-definitions/ts-tests/exports.ts new file mode 100644 index 0000000000..39f9d2fe49 --- /dev/null +++ b/type-definitions/ts-tests/exports.ts @@ -0,0 +1,112 @@ +// Some tests look like they are repeated in order to avoid false positives. + +import { expect, test } from 'tstyche'; +import * as Immutable from 'immutable'; +import { + List, + Map, + OrderedMap, + OrderedSet, + Range, + Repeat, + Seq, + Set, + Stack, + Collection, +} from 'immutable'; + +test('named imports', () => { + expect(List).type.toBe(); + + expect(Map).type.toBe(); + + expect(OrderedMap).type.toBe(); + + expect(OrderedSet).type.toBe(); + + expect(Range).type.toBe< + ( + start: number, + end: number, + step?: number | undefined + ) => Seq.Indexed + >(); + + expect(Repeat).type.toBe< + (value: T, times?: number | undefined) => Seq.Indexed + >(); + + expect(Seq).type.toBe(); + + expect(Set).type.toBe(); + + expect(Stack).type.toBe(); + + expect(Collection).type.toBe(); + + expect(Collection.Set).type.toBe< + ( + collection?: Iterable | ArrayLike | undefined + ) => Collection.Set + >(); + + expect(Collection.Keyed).type.toBe<{ + (collection?: Iterable<[K, V]> | undefined): Collection.Keyed; + (obj: { [key: string]: V }): Collection.Keyed; + }>(); + + expect(Collection.Indexed).type.toBe< + ( + collection?: Iterable | ArrayLike | undefined + ) => Collection.Indexed + >(); +}); + +test('namespace import', () => { + expect(Immutable.List).type.toBe(); + + expect(Immutable.Map).type.toBe(); + + expect(Immutable.OrderedMap).type.toBe(); + + expect(Immutable.OrderedSet).type.toBe(); + + expect(Immutable.Range).type.toBe< + ( + start: number, + end: number, + step?: number | undefined + ) => Immutable.Seq.Indexed + >(); + + expect(Immutable.Repeat).type.toBe< + (value: T, times?: number | undefined) => Immutable.Seq.Indexed + >(); + + expect(Immutable.Seq).type.toBe(); + + expect(Immutable.Set).type.toBe(); + + expect(Immutable.Stack).type.toBe(); + + expect(Immutable.Collection).type.toBe(); + + expect(Immutable.Collection.Set).type.toBe< + ( + collection?: Iterable | ArrayLike | undefined + ) => Immutable.Collection.Set + >(); + + expect(Immutable.Collection.Keyed).type.toBe<{ + ( + collection?: Iterable<[K, V]> | undefined + ): Immutable.Collection.Keyed; + (obj: { [key: string]: V }): Immutable.Collection.Keyed; + }>(); + + expect(Immutable.Collection.Indexed).type.toBe< + ( + collection?: Iterable | ArrayLike | undefined + ) => Immutable.Collection.Indexed + >(); +}); diff --git a/type-definitions/ts-tests/from-js.ts b/type-definitions/ts-tests/from-js.ts new file mode 100644 index 0000000000..f04a1e78f8 --- /dev/null +++ b/type-definitions/ts-tests/from-js.ts @@ -0,0 +1,46 @@ +import { expect, test } from 'tstyche'; +import { fromJS, Collection, List, Map, MapOf } from 'immutable'; + +test('fromJS', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + expect(fromJS({}, (a: any, b: any) => b)).type.toBe< + Collection + >(); + + expect(fromJS('abc')).type.toBe(); + + expect(fromJS([0, 1, 2])).type.toBe>(); + + expect(fromJS(List([0, 1, 2]))).type.toBe>(); + + expect(fromJS({ a: 0, b: 1, c: 2 })).type.toBe< + Map<'b' | 'a' | 'c', number> + >(); + + expect(fromJS(Map({ a: 0, b: 1, c: 2 }))).type.toBe< + MapOf<{ a: number; b: number; c: number }> + >(); + + expect(fromJS([{ a: 0 }])).type.toBe>>(); + + expect(fromJS({ a: [0] })).type.toBe>>(); + + expect(fromJS([[[0]]])).type.toBe>>>(); + + expect(fromJS({ a: { b: { c: 0 } } })).type.toBe< + Map<'a', Map<'b', Map<'c', number>>> + >(); +}); + +test('fromJS in an array of function', () => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const create = [(data: any) => data, fromJS][1]; + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + expect(create({ a: 'A' })).type.toBe(); + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const createConst = ([(data: any) => data, fromJS] as const)[1]; + + expect(createConst({ a: 'A' })).type.toBe>(); +}); diff --git a/type-definitions/ts-tests/functional.ts b/type-definitions/ts-tests/functional.ts new file mode 100644 index 0000000000..01a8636c50 --- /dev/null +++ b/type-definitions/ts-tests/functional.ts @@ -0,0 +1,174 @@ +import { expect, test } from 'tstyche'; +import { + get, + getIn, + has, + hasIn, + set, + remove, + update, + Map, + List, + MapOf, +} from 'immutable'; + +test('get', () => { + expect(get([1, 2, 3], 0)).type.toBe(); + + expect(get([1, 2, 3], 0, 'a')).type.toBe(); + + expect(get({ x: 10, y: 20 }, 'x')).type.toBe(); + + expect(get({ x: 10, y: 20 }, 'z', 'missing')).type.toBe(); +}); + +test('getIn', () => { + expect(getIn('a', ['length' as const])).type.toBe(); + + expect(getIn([1, 2, 3], [0])).type.toBe(); + + // first parameter type is Array so we can not detect that the number will be invalid + expect(getIn([1, 2, 3], [99])).type.toBe(); + + // We do not handle List in getIn TS type yet (hard to convert to a tuple) + expect(getIn([1, 2, 3], List([0]))).type.toBe(); + + expect(getIn([1, 2, 3], [0], 'a' as const)).type.toBe(); + + expect(getIn(List([1, 2, 3]), [0])).type.toBe(); + + // first parameter type is Array so we can not detect that the number will be invalid + expect(getIn(List([1, 2, 3]), [99])).type.toBe(); + + expect(getIn(List([1, 2, 3]), ['a' as const])).type.toBe(); + + expect( + getIn(List([1, 2, 3]), ['a' as const], 'missing') + ).type.toBe<'missing'>(); + + expect(getIn({ x: 10, y: 20 }, ['x' as const])).type.toBe(); + + expect( + getIn({ x: 10, y: 20 }, ['z' as const], 'missing') + ).type.toBe<'missing'>(); + + expect(getIn({ x: { y: 20 } }, ['x' as const])).type.toBe<{ y: number }>(); + + expect(getIn({ x: { y: 20 } }, ['z' as const])).type.toBe(); + + expect( + getIn({ x: { y: 20 } }, ['x' as const, 'y' as const]) + ).type.toBe(); + + expect( + getIn({ x: Map({ y: 20 }) }, ['x' as const, 'y' as const]) + ).type.toBe(); + + expect( + getIn(Map({ x: Map({ y: 20 }) }), ['x' as const, 'y' as const]) + ).type.toBe(); + + const o = Map({ x: List([Map({ y: 20 })]) }); + + expect(getIn(o, ['x' as const, 'y' as const])).type.toBe(); + + expect(getIn(o, ['x' as const])).type.toBe>>(); + + expect(getIn(o, ['x' as const, 0])).type.toBe>(); + + expect(getIn(o, ['x' as const, 0, 'y' as const])).type.toBe(); +}); + +test('has', () => { + expect(has([1, 2, 3], 0)).type.toBe(); + + expect(has({ x: 10, y: 20 }, 'x')).type.toBe(); +}); + +test('hasIn', () => { + expect(hasIn('a', ['length' as const])).type.toBe(); + + expect(hasIn(123, [])).type.toBe(); + + expect(hasIn(true, [])).type.toBe(); + + expect(hasIn([1, 2, 3], [0])).type.toBe(); + + // first parameter type is Array so we can not detect that the number will be invalid + expect(hasIn([1, 2, 3], [99])).type.toBe(); + + // We do not handle List in hasIn TS type yet (hard to convert to a tuple) + expect(hasIn([1, 2, 3], List([0]))).type.toBe(); + + expect(hasIn(List([1, 2, 3]), [0])).type.toBe(); + + // first parameter type is Array so we can not detect that the number will be invalid + expect(hasIn(List([1, 2, 3]), [99])).type.toBe(); + + expect(hasIn(List([1, 2, 3]), ['a' as const])).type.toBe(); + + expect(hasIn({ x: 10, y: 20 }, ['x' as const])).type.toBe(); + + expect(hasIn({ x: { y: 20 } }, ['z' as const])).type.toBe(); + + expect( + hasIn({ x: { y: 20 } }, ['x' as const, 'y' as const]) + ).type.toBe(); + + expect( + hasIn({ x: Map({ y: 20 }) }, ['x' as const, 'y' as const]) + ).type.toBe(); + + expect( + hasIn(Map({ x: Map({ y: 20 }) }), ['x' as const, 'y' as const]) + ).type.toBe(); + + const o = Map({ x: List([Map({ y: 20 })]) }); + + expect(hasIn(o, ['x' as const, 'y' as const])).type.toBe(); + + expect(hasIn(o, ['x' as const, 0, 'y' as const])).type.toBe(); +}); + +test('set', () => { + expect(set([1, 2, 3], 0, 10)).type.toBe(); + + expect(set([1, 2, 3], 0, 'a')).type.toRaiseError(); + + expect(set([1, 2, 3], 'a', 0)).type.toRaiseError(); + + expect(set({ x: 10, y: 20 }, 'x', 100)).type.toBe<{ + x: number; + y: number; + }>(); + + expect(set({ x: 10, y: 20 }, 'x', 'a')).type.toRaiseError(); +}); + +test('remove', () => { + expect(remove([1, 2, 3], 0)).type.toBe(); + + expect(remove({ x: 10, y: 20 }, 'x')).type.toBe<{ + x: number; + y: number; + }>(); +}); + +test('update', () => { + expect(update([1, 2, 3], 0, (v: number) => v + 1)).type.toBe(); + + expect(update([1, 2, 3], 0, 1)).type.toRaiseError(); + + expect(update([1, 2, 3], 0, (v: string) => v + 'a')).type.toRaiseError(); + + expect(update([1, 2, 3], 'a', (v: number) => v + 1)).type.toRaiseError(); + + expect(update({ x: 10, y: 20 }, 'x', (v: number) => v + 1)).type.toBe<{ + x: number; + y: number; + }>(); + + expect( + update({ x: 10, y: 20 }, 'x', (v: string) => v + 'a') + ).type.toRaiseError(); +}); diff --git a/type-definitions/ts-tests/groupBy.ts b/type-definitions/ts-tests/groupBy.ts new file mode 100644 index 0000000000..141bfc2912 --- /dev/null +++ b/type-definitions/ts-tests/groupBy.ts @@ -0,0 +1,59 @@ +import { expect, test } from 'tstyche'; +import { + Collection, + List, + Map, + OrderedMap, + Set, + OrderedSet, + Seq, + Stack, + MapOf, +} from 'immutable'; + +test('groupBy', () => { + expect(Collection(['a', 'b', 'c', 'a']).groupBy((v) => v)).type.toBe< + Map> + >(); + + expect( + Collection({ a: 1, b: 2, c: 3, d: 1 }).groupBy((v) => `key-${v}`) + ).type.toBe>>(); + + expect(List(['a', 'b', 'c', 'a']).groupBy((v) => v)).type.toBe< + Map> + >(); + + expect(Seq(['a', 'b', 'c', 'a']).groupBy((v) => v)).type.toBe< + Map> + >(); + + expect(Seq({ a: 1, b: 2, c: 3, d: 1 }).groupBy((v) => `key-${v}`)).type.toBe< + Map> + >(); + + expect(Set(['a', 'b', 'c', 'a']).groupBy((v) => v)).type.toBe< + Map> + >(); + + expect(Stack(['a', 'b', 'c', 'a']).groupBy((v) => v)).type.toBe< + Map> + >(); + + expect(OrderedSet(['a', 'b', 'c', 'a']).groupBy((v) => v)).type.toBe< + Map> + >(); + + expect( + Map({ a: 1, b: 2, c: 3, d: 1 }).groupBy((v) => `key-${v}`) + ).type.toBe>>(); + + // type should be something like Map>> but groupBy returns a wrong type with `this` + expect(Map({ a: 1, b: 2, c: 3, d: 1 }).groupBy((v) => `key-${v}`)).type.toBe< + Map> + >(); + + expect( + OrderedMap({ a: 1, b: 2, c: 3, d: 1 }).groupBy((v) => `key-${v}`) + ).type.toBe>>(); +}); diff --git a/type-definitions/ts-tests/list.ts b/type-definitions/ts-tests/list.ts new file mode 100644 index 0000000000..2b86dca369 --- /dev/null +++ b/type-definitions/ts-tests/list.ts @@ -0,0 +1,403 @@ +import { expect, pick, test } from 'tstyche'; +import { + List, + get, + set, + remove, + update, + setIn, + removeIn, + updateIn, + merge, +} from 'immutable'; + +test('#constructor', () => { + expect(List()).type.toBe>(); + + expect>().type.toBeAssignableWith(List()); + + expect>().type.toBeAssignableWith(List([1, 'a'])); + expect>().type.not.toBeAssignableWith(List([1, 'a'])); +}); + +test('#size', () => { + expect(pick(List(), 'size')).type.toBe<{ readonly size: number }>(); +}); + +test('#setSize', () => { + expect(List().setSize(10)).type.toBe>(); + + expect(List().setSize('foo')).type.toRaiseError(); +}); + +test('.of', () => { + expect(List.of(1, 2, 3)).type.toBe>(); + + expect(List.of('a', 1)).type.toRaiseError(); + + expect(List.of('a', 1)).type.toBe>(); +}); + +test('#get', () => { + expect(List().get(4)).type.toBe(); + + expect(List().get(4, 'a')).type.toBe(); + + expect(List().get(4, 'a')).type.toRaiseError(); + + expect(get(List(), 4)).type.toBe(); + + expect(get(List(), 4, 'a')).type.toBe(); +}); + +test('#set', () => { + expect(List().set(0, 0)).type.toBe>(); + + expect(List().set(1, 'a')).type.toRaiseError(); + + expect(List().set('a', 1)).type.toRaiseError(); + + expect(List().set(0, 1)).type.toBe>(); + + expect(List().set(0, 'a')).type.toBe< + List + >(); + + expect(set(List(), 0, 0)).type.toBe>(); +}); + +test('#first', () => { + const a = List().first(); + // ^? + expect(List().first()).type.toBe(); + expect(List().first('first')).type.toBe(); +}); + +test('#last', () => { + expect(List().last()).type.toBe(); + expect(List().last('last')).type.toBe(); +}); + +test('#set', () => { + expect(set(List(), 1, 'a')).type.toRaiseError(); + + expect(set(List(), 'a', 1)).type.toRaiseError(); +}); + +test('#setIn', () => { + expect(List().setIn([], 0)).type.toBe>(); + + expect(setIn(List(), [], 0)).type.toBe>(); +}); + +test('#insert', () => { + expect(List().insert(0, 0)).type.toBe>(); + + expect(List().insert(1, 'a')).type.toRaiseError(); + + expect(List().insert('a', 1)).type.toRaiseError(); + + expect(List().insert(0, 1)).type.toBe< + List + >(); + + expect(List().insert(0, 'a')).type.toBe< + List + >(); +}); + +test('#push', () => { + expect(List().push(0, 0)).type.toBe>(); + + expect(List().push(1, 'a')).type.toRaiseError(); + + expect(List().push('a', 1)).type.toRaiseError(); + + expect(List().push(0, 1)).type.toBe>(); + + expect(List().push(0, 'a')).type.toBe< + List + >(); +}); + +test('#unshift', () => { + expect(List().unshift(0, 0)).type.toBe>(); + + expect(List().unshift(1, 'a')).type.toRaiseError(); + + expect(List().unshift('a', 1)).type.toRaiseError(); + + expect(List().unshift(0, 1)).type.toBe< + List + >(); + + expect(List().unshift(0, 'a')).type.toBe< + List + >(); +}); + +test('#delete', () => { + expect(List().delete(0)).type.toBe>(); + + expect(List().delete('a')).type.toRaiseError(); +}); + +test('#deleteIn', () => { + expect(List().deleteIn([])).type.toBe>(); +}); + +test('#remove', () => { + expect(List().remove(0)).type.toBe>(); + + expect(List().remove('a')).type.toRaiseError(); + + expect(remove(List(), 0)).type.toBe>(); +}); + +test('#removeIn', () => { + expect(List().removeIn([])).type.toBe>(); + + expect(removeIn(List(), [])).type.toBe>(); +}); + +test('#clear', () => { + expect(List().clear()).type.toBe>(); + + expect(List().clear(10)).type.toRaiseError(); +}); + +test('#pop', () => { + expect(List().pop()).type.toBe>(); + + expect(List().pop(10)).type.toRaiseError(); +}); + +test('#shift', () => { + expect(List().shift()).type.toBe>(); + + expect(List().shift(10)).type.toRaiseError(); +}); + +test('#update', () => { + expect(List().update((v) => 1)).type.toBe(); + + expect( + List().update((v: List | undefined) => v) + ).type.toRaiseError(); + + expect(List().update(0, (v: number | undefined) => 0)).type.toBe< + List + >(); + + expect( + List().update(0, (v: number | undefined) => v + 'a') + ).type.toRaiseError(); + + expect(List().update(1, 10, (v: number | undefined) => 0)).type.toBe< + List + >(); + + expect( + List().update(1, 'a', (v: number | undefined) => 0) + ).type.toRaiseError(); + + expect( + List().update(1, 10, (v: number | undefined) => v + 'a') + ).type.toRaiseError(); + + expect(List().update(1, (v) => v?.toUpperCase())).type.toBe< + List + >(); + + expect(update(List(), 0, (v: number | undefined) => 0)).type.toBe< + List + >(); + + expect( + update(List(), 1, 10, (v: number) => v + 'a') + ).type.toRaiseError(); +}); + +test('#updateIn', () => { + expect(List().updateIn([], (v) => v)).type.toBe>(); + + expect(List().updateIn([], 10)).type.toRaiseError(); + + expect(updateIn(List(), [], (v) => v)).type.toBe>(); +}); + +test('#map', () => { + expect( + List().map((value: number, key: number, iter: List) => 1) + ).type.toBe>(); + + expect( + List().map((value: number, key: number, iter: List) => 'a') + ).type.toBe>(); + + expect( + List().map( + (value: number, key: number, iter: List) => 1 + ) + ).type.toBe>(); + + expect( + List().map( + (value: number, key: number, iter: List) => 1 + ) + ).type.toRaiseError(); + + expect( + List().map( + (value: string, key: number, iter: List) => 1 + ) + ).type.toRaiseError(); + + expect( + List().map( + (value: number, key: string, iter: List) => 1 + ) + ).type.toRaiseError(); + + expect( + List().map( + (value: number, key: number, iter: List) => 1 + ) + ).type.toRaiseError(); + + expect( + List().map( + (value: number, key: number, iter: List) => 'a' + ) + ).type.toRaiseError(); +}); + +test('#flatMap', () => { + expect( + List().flatMap((value: number, key: number, iter: List) => [ + 1, + ]) + ).type.toBe>(); + + expect( + List().flatMap((value: number, key: number, iter: List) => [ + 'a', + ]) + ).type.toBe>(); + + expect(List>().flatMap((list) => list)).type.toBe< + List + >(); + + expect( + List().flatMap( + (value: number, key: number, iter: List) => [1] + ) + ).type.toBe>(); + + expect( + List().flatMap( + (value: number, key: number, iter: List) => [1] + ) + ).type.toRaiseError(); + + expect( + List().flatMap( + (value: string, key: number, iter: List) => [1] + ) + ).type.toRaiseError(); + + expect( + List().flatMap( + (value: number, key: string, iter: List) => [1] + ) + ).type.toRaiseError(); + + expect( + List().flatMap( + (value: number, key: number, iter: List) => [1] + ) + ).type.toRaiseError(); + + expect( + List().flatMap( + (value: number, key: number, iter: List) => ['a'] + ) + ).type.toRaiseError(); +}); + +test('#merge', () => { + expect(List().merge(List())).type.toBe>(); + + expect(List().merge(List())).type.toBe< + List + >(); + + expect(List().merge(List())).type.toBe< + List + >(); + + expect(List().merge(List())).type.toBe< + List + >(); + + expect(merge(List(), List())).type.toBe>(); +}); + +test('#mergeIn', () => { + expect(List().mergeIn([], [])).type.toBe>(); +}); + +test('#mergeDeepIn', () => { + expect(List().mergeDeepIn([], [])).type.toBe>(); +}); + +test('#flatten', () => { + expect(List().flatten()).type.toBe< + Immutable.Collection + >(); + + expect(List().flatten(10)).type.toBe< + Immutable.Collection + >(); + + expect(List().flatten(false)).type.toBe< + Immutable.Collection + >(); + + expect(List().flatten('a')).type.toRaiseError(); +}); + +test('#withMutations', () => { + expect(List().withMutations((mutable) => mutable)).type.toBe< + List + >(); + + expect( + List().withMutations((mutable: List) => mutable) + ).type.toRaiseError(); +}); + +test('#asMutable', () => { + expect(List().asMutable()).type.toBe>(); +}); + +test('#asImmutable', () => { + expect(List().asImmutable()).type.toBe>(); +}); + +test('#toJS', () => { + expect(List>().toJS()).type.toBe(); +}); + +test('#toJSON', () => { + expect(List>().toJSON()).type.toBe[]>(); +}); + +test('for of loops', () => { + const list = List([1, 2, 3, 4]); + + for (const val of list) { + expect(val).type.toBe(); + } +}); diff --git a/type-definitions/ts-tests/map.ts b/type-definitions/ts-tests/map.ts new file mode 100644 index 0000000000..59f39eb36c --- /dev/null +++ b/type-definitions/ts-tests/map.ts @@ -0,0 +1,668 @@ +import { expect, pick, test } from 'tstyche'; +import { Map, List, MapOf, OrderedMap } from 'immutable'; + +test('#constructor', () => { + expect(Map()).type.toBe>(); + + expect(Map()).type.toBe>(); + + expect(Map([[1, 'a']])).type.toBe>(); + + expect(Map([['a', 'a']])).type.toBe>(); + + expect(Map(List<[number, string]>([[1, 'a']]))).type.toBe< + Map + >(); + + expect(Map({ a: 1 })).type.toBe>(); + + expect(Map({ a: 1, b: 'b' })).type.toBe>(); + + expect(Map({ a: Map({ b: Map({ c: 3 }) }) })).type.toBe< + MapOf<{ a: MapOf<{ b: MapOf<{ c: number }> }> }> + >(); + + expect(Map<{ a: string }>({ a: 1 })).type.toRaiseError(); + + expect(Map<{ a: string }>({ a: 'a', b: 'b' })).type.toRaiseError(); + + // TODO this type is really weird, it should be `Map` or MapOf<{ a: string }> See https://github.com/immutable-js/immutable-js/pull/1991#discussion_r1510863932 + expect(Map(List([List(['a', 'b'])]))).type.toBe>>>(); + + expect(Map([[1, 'a']])).type.not.toBeAssignableTo>(); + + expect(Map<'status', string>({ status: 'paid' })).type.toBe< + Map<'status', string> + >(); + + expect(Map<'status' | 'amount', string>({ status: 'paid' })).type.toBe< + Map<'status' | 'amount', string> + >(); + + expect( + Map<'status', string>({ status: 'paid', amount: 10 }) + ).type.toRaiseError(); +}); + +test('#size', () => { + expect(pick(Map(), 'size')).type.toBe<{ readonly size: number }>(); +}); + +test('#get', () => { + expect(Map().get(4)).type.toBe(); + + expect(Map().get(4, 'a')).type.toBe(); + + expect(Map().get(4, 'a')).type.toRaiseError(); + + expect(Map({ a: 4, b: true }).get('a')).type.toBe(); + + expect(Map({ a: 4, b: true }).get('b')).type.toBe(); + + expect( + Map({ a: Map({ b: true }) }) + .get('a') + .get('b') + ).type.toBe(); + + expect(Map({ a: 4 }).get('b')).type.toRaiseError(); + + expect(Map({ a: 4 }).get('b', undefined)).type.toBe(); + + expect(Map({ 1: 4 }).get(1)).type.toBe(); + + expect(Map({ 1: 4 }).get(2)).type.toRaiseError(); + + expect(Map({ 1: 4 }).get(2, 3)).type.toBe<3>(); + + const s1 = Symbol('s1'); + + expect(Map({ [s1]: 4 }).get(s1)).type.toBe(); + + const s2 = Symbol('s2'); + + expect(Map({ [s2]: 4 }).get(s1)).type.toRaiseError(); +}); + +test('#getIn', () => { + const result = Map({ a: 4, b: true }).getIn(['a']); + + expect(result).type.toBe(); + + expect(Map({ a: 4, b: true }).getIn(['a' as const])).type.toBe(); + + expect( + Map({ a: Map({ b: Map({ c: Map({ d: 4 }) }) }) }).getIn([ + 'a' as const, + 'b' as const, + 'c' as const, + 'd' as const, + ]) + ).type.toBe(); + + expect(Map({ a: [1] }).getIn(['a' as const, 0])).type.toBe(); + + expect(Map({ a: List([1]) }).getIn(['a' as const, 0])).type.toBe(); +}); + +test('#set', () => { + expect(Map().set(0, 0)).type.toBe>(); + + expect(Map().set(1, 'a')).type.toRaiseError(); + + expect(Map().set('a', 1)).type.toRaiseError(); + + expect(Map().set(0, 1)).type.toBe< + Map + >(); + + expect(Map().set(0, 'a')).type.toBe< + Map + >(); + + expect(Map({ a: 1 }).set('b', 'b')).type.toRaiseError(); + + expect(Map<{ a: number; b?: string }>({ a: 1 }).set('b', 'b')).type.toBe< + MapOf<{ a: number; b?: string | undefined }> + >(); + + expect( + Map<{ a: number; b?: string }>({ a: 1 }).set('b', undefined) + ).type.toBe>(); + + expect( + Map<{ a: number; b?: string }>({ a: 1 }).set('b', 'b').get('a') + ).type.toBe(); + + expect( + Map<{ a: number; b?: string }>({ a: 1 }).set('b', 'b').get('b') + ).type.toBe(); + + const customer = Map<{ phone: string | number }>({ + phone: 'bar', + }); + + expect(customer).type.toBeAssignableWith(customer.set('phone', 8)); +}); + +test('#setIn', () => { + expect(Map().setIn([], 0)).type.toBe>(); +}); + +test('#delete', () => { + expect(Map().delete(0)).type.toBe>(); + + expect(Map().delete('a')).type.toRaiseError(); + + expect(Map({ a: 1, b: 'b' }).delete('b')).type.toBe(); + + expect( + Map<{ a: number; b?: string }>({ a: 1, b: 'b' }).delete('b') + ).type.toBe>(); + + expect( + Map<{ a?: number; b?: string }>({ a: 1, b: 'b' }).remove('b').delete('a') + ).type.toBe>(); + + expect( + Map<{ a: number; b?: string }>({ a: 1, b: 'b' }).remove('b').get('a') + ).type.toBe(); + + expect( + Map<{ a: number; b?: string }>({ a: 1, b: 'b' }).remove('b').get('b') + ).type.toBe(); +}); + +test('#deleteAll', () => { + expect(Map().deleteAll([0])).type.toBe>(); + + expect(Map().deleteAll([0, 'a'])).type.toRaiseError(); +}); + +test('#deleteIn', () => { + expect(Map().deleteIn([])).type.toBe>(); +}); + +test('#remove', () => { + expect(Map().remove(0)).type.toBe>(); + + expect(Map().remove('a')).type.toRaiseError(); +}); + +test('#removeAll', () => { + expect(Map().removeAll([0])).type.toBe>(); + + expect(Map().removeAll([0, 'a'])).type.toRaiseError(); +}); + +test('#removeIn', () => { + expect(Map().removeIn([])).type.toBe>(); +}); + +test('#clear', () => { + expect(Map().clear()).type.toBe>(); + + expect(Map().clear(10)).type.toRaiseError(); +}); + +test('#update', () => { + expect(Map().update((v) => 1)).type.toBe(); + + expect( + Map().update((v: Map | undefined) => v) + ).type.toRaiseError(); + + expect( + Map().update(0, (v: number | undefined) => 0) + ).type.toBe>(); + + expect( + Map().update(0, (v: number | undefined) => v + 'a') + ).type.toRaiseError(); + + expect( + Map().update(1, 10, (v: number | undefined) => 0) + ).type.toBe>(); + + expect( + Map().update(1, 'a', (v: number | undefined) => 0) + ).type.toRaiseError(); + + expect( + Map().update(1, 10, (v: number | undefined) => v + 'a') + ).type.toRaiseError(); + + expect(Map({ a: 1, b: 'b' }).update('c', (v) => v)).type.toRaiseError(); + + expect(Map({ a: 1, b: 'b' }).update('b', (v) => v.toUpperCase())).type.toBe< + MapOf<{ a: number; b: string }> + >(); + + expect( + Map({ a: 1, b: 'b' }).update('b', 'NSV', (v) => v.toUpperCase()) + ).type.toBe>(); + + expect(Map({ a: 1, b: 'b' }).update((v) => ({ a: 'a' }))).type.toRaiseError(); + + expect( + Map({ a: 1, b: 'b' }).update((v) => v.set('a', 2).set('b', 'B')) + ).type.toBe>(); + + expect( + Map({ a: 1, b: 'b' }).update((v) => v.set('c', 'c')) + ).type.toRaiseError(); + + expect( + Map().update('noKey', (ls) => ls?.toUpperCase()) + ).type.toBe>(); +}); + +test('#updateIn', () => { + expect(Map().updateIn([], (v) => v)).type.toBe< + Map + >(); + + expect(Map().updateIn([], 10)).type.toRaiseError(); +}); + +test('#map', () => { + expect( + Map().map( + (value: number, key: number, iter: Map) => 1 + ) + ).type.toBe>(); + + expect( + Map().map( + (value: number, key: number, iter: Map) => 'a' + ) + ).type.toBe>(); + + expect( + Map().map( + (value: number, key: number, iter: Map) => 1 + ) + ).type.toBe>(); + + expect( + Map().map( + (value: number, key: number, iter: Map) => 1 + ) + ).type.toRaiseError(); + + expect( + Map().map( + (value: string, key: number, iter: Map) => 1 + ) + ).type.toRaiseError(); + + expect( + Map().map( + (value: number, key: string, iter: Map) => 1 + ) + ).type.toRaiseError(); + + expect( + Map().map( + (value: number, key: number, iter: Map) => 1 + ) + ).type.toRaiseError(); + + expect( + Map().map( + (value: number, key: number, iter: Map) => 'a' + ) + ).type.toRaiseError(); +}); + +test('#mapKeys', () => { + expect( + Map().mapKeys( + (value: number, key: number, iter: Map) => 1 + ) + ).type.toBe>(); + + expect( + Map().mapKeys( + (value: number, key: number, iter: Map) => 'a' + ) + ).type.toBe>(); + + expect( + Map().mapKeys( + (value: number, key: number, iter: Map) => 1 + ) + ).type.toBe>(); + + expect( + Map().mapKeys( + (value: number, key: number, iter: Map) => 1 + ) + ).type.toRaiseError(); + + expect( + Map().mapKeys( + (value: string, key: number, iter: Map) => 1 + ) + ).type.toRaiseError(); + + expect( + Map().mapKeys( + (value: number, key: string, iter: Map) => 1 + ) + ).type.toRaiseError(); + + expect( + Map().mapKeys( + (value: number, key: number, iter: Map) => 1 + ) + ).type.toRaiseError(); + + expect( + Map().mapKeys( + (value: number, key: number, iter: Map) => 'a' + ) + ).type.toRaiseError(); +}); + +test('#flatMap', () => { + expect( + Map().flatMap( + (value: number, key: number, iter: Map) => [[0, 1]] + ) + ).type.toBe>(); + + expect( + Map().flatMap( + (value: number, key: number, iter: Map) => [['a', 'b']] + ) + ).type.toBe>(); + + expect( + Map().flatMap( + (value: number, key: number, iter: Map) => [[0, 1]] + ) + ).type.toBe>(); + + expect( + Map().flatMap( + (value: number, key: number, iter: Map) => [[0, 1]] + ) + ).type.toRaiseError(); + + expect( + Map().flatMap( + (value: string, key: number, iter: Map) => [[0, 1]] + ) + ).type.toRaiseError(); + + expect( + Map().flatMap( + (value: number, key: string, iter: Map) => [[0, 1]] + ) + ).type.toRaiseError(); + + expect( + Map().flatMap( + (value: number, key: number, iter: Map) => [[0, 1]] + ) + ).type.toRaiseError(); + + expect( + Map().flatMap( + (value: number, key: number, iter: Map) => [[0, 'a']] + ) + ).type.toRaiseError(); +}); + +test('#merge', () => { + expect(Map().merge({ a: 1 })).type.toBe< + Map + >(); + + expect(Map().merge({ a: { b: 1 } })).type.toBe< + Map + >(); + + expect(Map().merge(Map())).type.toBe< + Map + >(); + + expect(Map().merge(Map())).type.toBe< + Map + >(); + + expect(Map().merge(Map())).type.toBe< + Map + >(); + + expect(Map().merge(Map())).type.toBe< + Map + >(); + + expect(Map({ a: 1 }).merge(Map({ b: 2 }))).type.toBe< + Map<'b' | 'a', number> + >(); +}); + +test('#mergeIn', () => { + expect(Map().mergeIn([], [])).type.toBe< + Map + >(); +}); + +test('#mergeWith', () => { + expect( + Map().mergeWith( + (prev: number, next: number, key: number) => 1, + Map() + ) + ).type.toBe>(); + + expect( + Map().mergeWith( + (prev: string, next: number, key: number) => 1, + Map() + ) + ).type.toRaiseError(); + + expect( + Map().mergeWith( + (prev: number, next: string, key: number) => 1, + Map() + ) + ).type.toRaiseError(); + + expect( + Map().mergeWith( + (prev: number, next: number, key: string) => 1, + Map() + ) + ).type.toRaiseError(); + + expect( + Map().mergeWith( + (prev: number, next: number, key: number) => 'a', + Map() + ) + ).type.toBe>(); + + expect( + Map().mergeWith( + (prev: number, next: number, key: number) => 1, + Map() + ) + ).type.toRaiseError(); + + expect( + Map().mergeWith( + (prev: number, next: number, key: string) => 1, + { a: 1 } + ) + ).type.toBe>(); + + expect( + Map().mergeWith( + (prev: number, next: number, key: string) => 1, + { a: 'a' } + ) + ).type.toRaiseError(); + + expect( + Map().mergeWith( + (prev: number, next: number | string, key: string) => 1, + { a: 'a' } + ) + ).type.toBe>(); + + expect( + Map().mergeWith( + (prev: number | string, next: number | string, key: number) => 1, + Map() + ) + ).type.toBe>(); +}); + +test('#mergeDeep', () => { + expect(Map().mergeDeep({ a: 1 })).type.toBe< + Map + >(); + + expect(Map().mergeDeep({ a: { b: 1 } })).type.toBe< + Map + >(); + + expect(Map().mergeDeep(Map({ a: { b: 1 } }))).type.toBe< + Map + >(); + + expect(Map().mergeDeep(Map())).type.toBe< + Map + >(); + + expect(Map().mergeDeep(Map())).type.toBe< + Map + >(); + + expect( + Map().mergeDeep(Map()) + ).type.toBe>(); + + expect( + Map().mergeDeep(Map()) + ).type.toBe>(); +}); + +test('#mergeDeepIn', () => { + expect(Map().mergeDeepIn([], [])).type.toBe< + Map + >(); +}); + +test('#mergeDeepWith', () => { + expect( + Map().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + Map() + ) + ).type.toBe>(); + + expect( + Map().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + Map() + ) + ).type.toRaiseError(); + + expect( + Map().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + { a: 1 } + ) + ).type.toBe>(); + + expect( + Map().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + { a: 'a' } + ) + ).type.toRaiseError(); + + expect( + Map().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + Map() + ) + ).type.toBe>(); +}); + +test('#flip', () => { + expect(Map().flip()).type.toBe>(); +}); + +test('#sort', () => { + expect(Map().sort()).type.toBe< + Map & OrderedMap + >(); + expect(Map().sort((a, b) => 1)).type.toBe< + Map & OrderedMap + >(); + + expect(Map({ a: 'a' }).sort()).type.toBe< + MapOf<{ a: string }> & OrderedMap<'a', string> + >(); +}); + +test('#sortBy', () => { + expect(Map().sortBy((v) => v)).type.toBe< + Map & OrderedMap + >(); + + expect( + Map().sortBy( + (v) => v, + (a, b) => 1 + ) + ).type.toBe & OrderedMap>(); + expect(Map({ a: 'a' }).sortBy((v) => v)).type.toBe< + MapOf<{ a: string }> & OrderedMap<'a', string> + >(); +}); + +test('#withMutations', () => { + expect(Map().withMutations((mutable) => mutable)).type.toBe< + Map + >(); + + expect( + Map().withMutations((mutable: Map) => mutable) + ).type.toRaiseError(); +}); + +test('#asMutable', () => { + expect(Map().asMutable()).type.toBe>(); +}); + +test('#asImmutable', () => { + expect(Map().asImmutable()).type.toBe>(); +}); + +test('#toJS', () => { + expect(Map().toJS()).type.toBe<{ + [x: string]: number; + [x: number]: number; + [x: symbol]: number; + }>(); + + expect(Map({ a: 'A' }).toJS()).type.toBe<{ a: string }>(); + + expect(Map({ a: Map({ b: 'b' }) }).toJS()).type.toBe<{ + a: { b: string }; + }>(); +}); + +test('#toJSON', () => { + expect(Map({ a: Map({ b: 'b' }) }).toJSON()).type.toBe<{ + a: MapOf<{ b: string }>; + }>(); +}); diff --git a/type-definitions/ts-tests/ordered-map.ts b/type-definitions/ts-tests/ordered-map.ts new file mode 100644 index 0000000000..56341ff76e --- /dev/null +++ b/type-definitions/ts-tests/ordered-map.ts @@ -0,0 +1,504 @@ +import { expect, pick, test } from 'tstyche'; +import { OrderedMap, List } from 'immutable'; + +test('#constructor', () => { + expect(OrderedMap()).type.toBe>(); + + expect(OrderedMap()).type.toBe>(); + + expect(OrderedMap([[1, 'a']])).type.toBe>(); + + expect(OrderedMap(List<[number, string]>([[1, 'a']]))).type.toBe< + OrderedMap + >(); + + expect(OrderedMap({ a: 1 })).type.toBe>(); + + // No longer works in typescript@>=3.9 + // // $ExpectError - TypeScript does not support Lists as tuples + // OrderedMap(List([List(['a', 'b'])])); +}); + +test('#size', () => { + expect(pick(OrderedMap(), 'size')).type.toBe<{ readonly size: number }>(); +}); + +test('#get', () => { + expect(OrderedMap().get(4)).type.toBe(); + + expect(OrderedMap().get(4, 'a')).type.toBe(); + + expect(OrderedMap().get(4, 'a')).type.toRaiseError(); +}); + +test('#set', () => { + expect(OrderedMap().set(0, 0)).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().set(1, 'a')).type.toRaiseError(); + + expect(OrderedMap().set('a', 1)).type.toRaiseError(); + + expect(OrderedMap().set(0, 1)).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().set(0, 'a')).type.toBe< + OrderedMap + >(); +}); + +test('#setIn', () => { + expect(OrderedMap().setIn([], 0)).type.toBe< + OrderedMap + >(); +}); + +test('#delete', () => { + expect(OrderedMap().delete(0)).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().delete('a')).type.toRaiseError(); +}); + +test('#deleteAll', () => { + expect(OrderedMap().deleteAll([0])).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().deleteAll([0, 'a'])).type.toRaiseError(); +}); + +test('#deleteIn', () => { + expect(OrderedMap().deleteIn([])).type.toBe< + OrderedMap + >(); +}); + +test('#remove', () => { + expect(OrderedMap().remove(0)).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().remove('a')).type.toRaiseError(); +}); + +test('#removeAll', () => { + expect(OrderedMap().removeAll([0])).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().removeAll([0, 'a'])).type.toRaiseError(); +}); + +test('#removeIn', () => { + expect(OrderedMap().removeIn([])).type.toBe< + OrderedMap + >(); +}); + +test('#clear', () => { + expect(OrderedMap().clear()).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().clear(10)).type.toRaiseError(); +}); + +test('#update', () => { + expect(OrderedMap().update((v) => 1)).type.toBe(); + + expect( + OrderedMap().update( + (v: OrderedMap | undefined) => v + ) + ).type.toRaiseError(); + + expect( + OrderedMap().update(0, (v: number | undefined) => 0) + ).type.toBe>(); + + expect( + OrderedMap().update(0, (v: number | undefined) => v + 'a') + ).type.toRaiseError(); + + expect( + OrderedMap().update(1, 10, (v: number | undefined) => 0) + ).type.toBe>(); + + expect( + OrderedMap().update(1, 'a', (v: number | undefined) => 0) + ).type.toRaiseError(); + + expect( + OrderedMap().update( + 1, + 10, + (v: number | undefined) => v + 'a' + ) + ).type.toRaiseError(); +}); + +test('#updateIn', () => { + expect(OrderedMap().updateIn([], (v) => v)).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().updateIn([], 10)).type.toRaiseError(); +}); + +test('#map', () => { + expect( + OrderedMap().map( + (value: number, key: number, iter: OrderedMap) => 1 + ) + ).type.toBe>(); + + expect( + OrderedMap().map( + (value: number, key: number, iter: OrderedMap) => 'a' + ) + ).type.toBe>(); + + expect( + OrderedMap().map( + (value: number, key: number, iter: OrderedMap) => 1 + ) + ).type.toBe>(); + + expect( + OrderedMap().map( + (value: number, key: number, iter: OrderedMap) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedMap().map( + (value: string, key: number, iter: OrderedMap) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedMap().map( + (value: number, key: string, iter: OrderedMap) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedMap().map( + (value: number, key: number, iter: OrderedMap) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedMap().map( + (value: number, key: number, iter: OrderedMap) => 'a' + ) + ).type.toRaiseError(); +}); + +test('#mapKeys', () => { + expect( + OrderedMap().mapKeys( + (value: number, key: number, iter: OrderedMap) => 1 + ) + ).type.toBe>(); + + expect( + OrderedMap().mapKeys( + (value: number, key: number, iter: OrderedMap) => 'a' + ) + ).type.toBe>(); + + expect( + OrderedMap().mapKeys( + (value: number, key: number, iter: OrderedMap) => 1 + ) + ).type.toBe>(); + + expect( + OrderedMap().mapKeys( + (value: number, key: number, iter: OrderedMap) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mapKeys( + (value: string, key: number, iter: OrderedMap) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mapKeys( + (value: number, key: string, iter: OrderedMap) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mapKeys( + (value: number, key: number, iter: OrderedMap) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mapKeys( + (value: number, key: number, iter: OrderedMap) => 'a' + ) + ).type.toRaiseError(); +}); + +test('#flatMap', () => { + expect( + OrderedMap().flatMap( + (value: number, key: number, iter: OrderedMap) => [[0, 1]] + ) + ).type.toBe>(); + + expect( + OrderedMap().flatMap( + (value: number, key: number, iter: OrderedMap) => [ + ['a', 'b'], + ] + ) + ).type.toBe>(); + + expect( + OrderedMap().flatMap( + (value: number, key: number, iter: OrderedMap) => [[0, 1]] + ) + ).type.toBe>(); + + expect( + OrderedMap().flatMap( + (value: number, key: number, iter: OrderedMap) => [[0, 1]] + ) + ).type.toRaiseError(); + + expect( + OrderedMap().flatMap( + (value: string, key: number, iter: OrderedMap) => [[0, 1]] + ) + ).type.toRaiseError(); + + expect( + OrderedMap().flatMap( + (value: number, key: string, iter: OrderedMap) => [[0, 1]] + ) + ).type.toRaiseError(); + + expect( + OrderedMap().flatMap( + (value: number, key: number, iter: OrderedMap) => [[0, 1]] + ) + ).type.toRaiseError(); + + expect( + OrderedMap().flatMap( + (value: number, key: number, iter: OrderedMap) => [ + [0, 'a'], + ] + ) + ).type.toRaiseError(); +}); + +test('#merge', () => { + expect(OrderedMap().merge({ a: 1 })).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().merge({ a: { b: 1 } })).type.toBe< + OrderedMap + >(); + + expect( + OrderedMap().merge(OrderedMap()) + ).type.toBe>(); + + expect( + OrderedMap().merge(OrderedMap()) + ).type.toBe>(); + + expect( + OrderedMap().merge(OrderedMap()) + ).type.toBe>(); + + expect( + OrderedMap().merge(OrderedMap()) + ).type.toBe>(); +}); + +test('#mergeIn', () => { + expect(OrderedMap().mergeIn([], [])).type.toBe< + OrderedMap + >(); +}); + +test('#mergeWith', () => { + expect( + OrderedMap().mergeWith( + (prev: number, next: number, key: number) => 1, + OrderedMap() + ) + ).type.toBe>(); + + expect( + OrderedMap().mergeWith( + (prev: string, next: number, key: number) => 1, + OrderedMap() + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mergeWith( + (prev: number, next: string, key: number) => 1, + OrderedMap() + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mergeWith( + (prev: number, next: number, key: string) => 1, + OrderedMap() + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mergeWith( + (prev: number, next: number, key: number) => 'a', + OrderedMap() + ) + ).type.toBe>(); + + expect( + OrderedMap().mergeWith( + (prev: number, next: number, key: number) => 1, + OrderedMap() + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mergeWith( + (prev: number, next: number, key: string) => 1, + { a: 1 } + ) + ).type.toBe>(); + + expect( + OrderedMap().mergeWith( + (prev: number, next: number, key: string) => 1, + { a: 'a' } + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mergeWith( + (prev: number | string, next: number | string, key: number) => 1, + OrderedMap() + ) + ).type.toBe>(); +}); + +test('#mergeDeep', () => { + expect(OrderedMap().mergeDeep({ a: 1 })).type.toBe< + OrderedMap + >(); + + expect(OrderedMap().mergeDeep({ a: { b: 1 } })).type.toBe< + OrderedMap + >(); + + expect( + OrderedMap().mergeDeep(OrderedMap()) + ).type.toBe>(); + + expect( + OrderedMap().mergeDeep(OrderedMap()) + ).type.toBe>(); + + expect( + OrderedMap().mergeDeep( + OrderedMap() + ) + ).type.toBe>(); + + expect( + OrderedMap().mergeDeep( + OrderedMap() + ) + ).type.toBe>(); +}); + +test('#mergeDeepIn', () => { + expect(OrderedMap().mergeDeepIn([], [])).type.toBe< + OrderedMap + >(); +}); + +test('#mergeDeepWith', () => { + expect( + OrderedMap().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + OrderedMap() + ) + ).type.toBe>(); + + expect( + OrderedMap().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + OrderedMap() + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + { a: 1 } + ) + ).type.toBe>(); + + expect( + OrderedMap().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + { a: 'a' } + ) + ).type.toRaiseError(); + + expect( + OrderedMap().mergeDeepWith( + (prev: unknown, next: unknown, key: unknown) => 1, + OrderedMap() + ) + ).type.toBe>(); +}); + +test('#flip', () => { + expect(OrderedMap().flip()).type.toBe< + OrderedMap + >(); +}); + +test('#withMutations', () => { + expect( + OrderedMap().withMutations((mutable) => mutable) + ).type.toBe>(); + + expect( + OrderedMap().withMutations( + (mutable: OrderedMap) => mutable + ) + ).type.toRaiseError(); +}); + +test('#asMutable', () => { + expect(OrderedMap().asMutable()).type.toBe< + OrderedMap + >(); +}); + +test('#asImmutable', () => { + expect(OrderedMap().asImmutable()).type.toBe< + OrderedMap + >(); +}); diff --git a/type-definitions/ts-tests/ordered-set.ts b/type-definitions/ts-tests/ordered-set.ts new file mode 100644 index 0000000000..b753c09a53 --- /dev/null +++ b/type-definitions/ts-tests/ordered-set.ts @@ -0,0 +1,278 @@ +import { expect, pick, test } from 'tstyche'; +import { Collection, OrderedSet, Map } from 'immutable'; + +test('#constructor', () => { + expect(OrderedSet()).type.toBe>(); + + expect(OrderedSet()).type.toBe>(); + + expect(OrderedSet([1, 'a'])).type.toBe>(); + + expect(OrderedSet([1, 'a'])).type.not.toBeAssignableTo(OrderedSet()); +}); + +test('#size', () => { + expect(pick(OrderedSet(), 'size')).type.toBe<{ readonly size: number }>(); +}); + +test('.of', () => { + expect(OrderedSet.of(1, 2, 3)).type.toBe>(); + + expect(OrderedSet.of('a', 1)).type.toRaiseError(); + + expect(OrderedSet.of('a', 1)).type.toBe< + OrderedSet + >(); +}); + +test('.fromKeys', () => { + expect(OrderedSet.fromKeys(Map())).type.toBe< + OrderedSet + >(); + + expect(OrderedSet.fromKeys(Map())).type.toBe< + OrderedSet + >(); + + expect(OrderedSet.fromKeys({ a: 1 })).type.toBe>(); + + expect( + OrderedSet.fromKeys(Map()) + ).type.toRaiseError(); + + expect( + OrderedSet.fromKeys(Map()) + ).type.toBe>(); +}); + +test('#get', () => { + expect(OrderedSet().get(4)).type.toBe(); + + expect(OrderedSet().get(4, 'a')).type.toBe(); + + expect(OrderedSet().get(4, 'a')).type.toRaiseError(); +}); + +test('#delete', () => { + expect(OrderedSet().delete(0)).type.toBe>(); + + expect(OrderedSet().delete('a')).type.toRaiseError(); +}); + +test('#remove', () => { + expect(OrderedSet().remove(0)).type.toBe>(); + + expect(OrderedSet().remove('a')).type.toRaiseError(); +}); + +test('#clear', () => { + expect(OrderedSet().clear()).type.toBe>(); + + expect(OrderedSet().clear(10)).type.toRaiseError(); +}); + +test('#map', () => { + expect( + OrderedSet().map( + (value: number, key: number, iter: OrderedSet) => 1 + ) + ).type.toBe>(); + + expect( + OrderedSet().map( + (value: number, key: number, iter: OrderedSet) => 'a' + ) + ).type.toBe>(); + + expect( + OrderedSet().map( + (value: number, key: number, iter: OrderedSet) => 1 + ) + ).type.toBe>(); + + expect( + OrderedSet().map( + (value: number, key: number, iter: OrderedSet) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedSet().map( + (value: string, key: number, iter: OrderedSet) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedSet().map( + (value: number, key: string, iter: OrderedSet) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedSet().map( + (value: number, key: number, iter: OrderedSet) => 1 + ) + ).type.toRaiseError(); + + expect( + OrderedSet().map( + (value: number, key: number, iter: OrderedSet) => 'a' + ) + ).type.toRaiseError(); +}); + +test('#flatMap', () => { + expect( + OrderedSet().flatMap( + (value: number, key: number, iter: OrderedSet) => [1] + ) + ).type.toBe>(); + + expect( + OrderedSet().flatMap( + (value: number, key: number, iter: OrderedSet) => ['a'] + ) + ).type.toBe>(); + + expect( + OrderedSet().flatMap( + (value: number, key: number, iter: OrderedSet) => [1] + ) + ).type.toBe>(); + + expect( + OrderedSet().flatMap( + (value: number, key: number, iter: OrderedSet) => [1] + ) + ).type.toRaiseError(); + + expect( + OrderedSet().flatMap( + (value: string, key: number, iter: OrderedSet) => [1] + ) + ).type.toRaiseError(); + + expect( + OrderedSet().flatMap( + (value: number, key: string, iter: OrderedSet) => [1] + ) + ).type.toRaiseError(); + + expect( + OrderedSet().flatMap( + (value: number, key: number, iter: OrderedSet) => [1] + ) + ).type.toRaiseError(); + + expect( + OrderedSet().flatMap( + (value: number, key: number, iter: OrderedSet) => ['a'] + ) + ).type.toRaiseError(); +}); + +test('#union', () => { + expect(OrderedSet().union(OrderedSet())).type.toBe< + OrderedSet + >(); + + expect(OrderedSet().union(OrderedSet())).type.toBe< + OrderedSet + >(); + + expect(OrderedSet().union(OrderedSet())).type.toBe< + OrderedSet + >(); + + expect(OrderedSet().union(OrderedSet())).type.toBe< + OrderedSet + >(); +}); + +test('#merge', () => { + expect(OrderedSet().merge(OrderedSet())).type.toBe< + OrderedSet + >(); + + expect(OrderedSet().merge(OrderedSet())).type.toBe< + OrderedSet + >(); + + expect(OrderedSet().merge(OrderedSet())).type.toBe< + OrderedSet + >(); + + expect(OrderedSet().merge(OrderedSet())).type.toBe< + OrderedSet + >(); +}); + +test('#intersect', () => { + expect(OrderedSet().intersect(OrderedSet())).type.toBe< + OrderedSet + >(); + + expect( + OrderedSet().intersect(OrderedSet()) + ).type.toRaiseError(); + + expect( + OrderedSet().intersect(OrderedSet()) + ).type.toBe>(); + + expect( + OrderedSet().intersect(OrderedSet()) + ).type.toBe>(); +}); + +test('#subtract', () => { + expect(OrderedSet().subtract(OrderedSet())).type.toBe< + OrderedSet + >(); + + expect( + OrderedSet().subtract(OrderedSet()) + ).type.toRaiseError(); + + expect( + OrderedSet().subtract(OrderedSet()) + ).type.toBe>(); + + expect( + OrderedSet().subtract(OrderedSet()) + ).type.toBe>(); +}); + +test('#flatten', () => { + expect(OrderedSet().flatten()).type.toBe< + Collection + >(); + + expect(OrderedSet().flatten(10)).type.toBe< + Collection + >(); + + expect(OrderedSet().flatten(false)).type.toBe< + Collection + >(); + + expect(OrderedSet().flatten('a')).type.toRaiseError(); +}); + +test('#withMutations', () => { + expect(OrderedSet().withMutations((mutable) => mutable)).type.toBe< + OrderedSet + >(); + + expect( + OrderedSet().withMutations((mutable: OrderedSet) => mutable) + ).type.toRaiseError(); +}); + +test('#asMutable', () => { + expect(OrderedSet().asMutable()).type.toBe>(); +}); + +test('#asImmutable', () => { + expect(OrderedSet().asImmutable()).type.toBe>(); +}); diff --git a/type-definitions/ts-tests/partition.ts b/type-definitions/ts-tests/partition.ts new file mode 100644 index 0000000000..a9d4871e94 --- /dev/null +++ b/type-definitions/ts-tests/partition.ts @@ -0,0 +1,184 @@ +/* eslint-disable @typescript-eslint/no-unused-expressions */ +import { expect, test } from 'tstyche'; +import { + Collection, + List, + Map, + OrderedMap, + OrderedSet, + Seq, + Set, +} from 'immutable'; + +abstract class A {} +class B extends A {} + +test('Collection', () => { + type Indexed = Collection.Indexed; + type Keyed = Collection.Keyed; + type Set = Collection.Set; + + (c: Collection) => { + expect(c.partition((x) => x % 2)).type.toBe< + [Collection, Collection] + >(); + }; + + (c: Collection) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Collection, Collection] + >(); + }; + + (c: Keyed) => { + expect(c.partition((x) => x % 2)).type.toBe< + [Keyed, Keyed] + >(); + }; + + (c: Keyed) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Keyed, Keyed] + >(); + }; + + (c: Indexed) => { + expect(c.partition((x) => x % 2)).type.toBe< + [Indexed, Indexed] + >(); + }; + + (c: Indexed) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Indexed, Indexed] + >(); + }; + + (c: Set) => { + expect(c.partition((x) => x % 2)).type.toBe<[Set, Set]>(); + }; + + (c: Set) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Set, Set] + >(); + }; +}); + +test('Seq', () => { + type Indexed = Seq.Indexed; + type Keyed = Seq.Keyed; + type Set = Seq.Set; + + (c: Seq) => { + expect(c.partition((x) => x % 2)).type.toBe< + [Seq, Seq] + >(); + }; + + (c: Seq) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Seq, Seq] + >(); + }; + + (c: Keyed) => { + expect(c.partition((x) => x % 2)).type.toBe< + [Keyed, Keyed] + >(); + }; + + (c: Keyed) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Keyed, Keyed] + >(); + }; + + (c: Indexed) => { + expect(c.partition((x) => x % 2)).type.toBe< + [Indexed, Indexed] + >(); + }; + + (c: Indexed) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Indexed, Indexed] + >(); + }; + + (c: Set) => { + expect(c.partition((x) => x % 2)).type.toBe<[Set, Set]>(); + }; + + (c: Set) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Set, Set] + >(); + }; +}); + +test('Map', () => { + (c: Map) => { + expect(c.partition((x) => x % 2)).type.toBe< + [Map, Map] + >(); + }; + + (c: Map) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Map, Map] + >(); + }; +}); + +test('OrderedMap', () => { + (c: OrderedMap) => { + expect(c.partition((x) => x % 2)).type.toBe< + [OrderedMap, OrderedMap] + >(); + }; + + (c: OrderedMap) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [OrderedMap, OrderedMap] + >(); + }; +}); + +test('List', () => { + (c: List) => { + expect(c.partition((x) => x % 2)).type.toBe<[List, List]>(); + }; + + (c: List) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [List, List] + >(); + }; +}); + +test('Set', () => { + (c: Set) => { + expect(c.partition((x) => x % 2)).type.toBe<[Set, Set]>(); + }; + + (c: Set) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [Set, Set] + >(); + }; +}); + +test('OrderedSet', () => { + (c: OrderedSet) => { + expect(c.partition((x) => x % 2)).type.toBe< + [OrderedSet, OrderedSet] + >(); + }; + + (c: OrderedSet) => { + expect(c.partition((x): x is B => x instanceof B)).type.toBe< + [OrderedSet, OrderedSet] + >(); + }; +}); diff --git a/type-definitions/ts-tests/range.ts b/type-definitions/ts-tests/range.ts new file mode 100644 index 0000000000..79db184113 --- /dev/null +++ b/type-definitions/ts-tests/range.ts @@ -0,0 +1,12 @@ +import { expect, test } from 'tstyche'; +import { Range, Seq } from 'immutable'; + +test('#constructor', () => { + expect(Range(0, 0, 1)).type.toBe>(); + + expect(Range('a', 0, 0)).type.toRaiseError(); + + expect(Range()).type.toRaiseError(); + + expect(Range(1)).type.toRaiseError(); +}); diff --git a/type-definitions/ts-tests/record.ts b/type-definitions/ts-tests/record.ts new file mode 100644 index 0000000000..bb2db4ee3a --- /dev/null +++ b/type-definitions/ts-tests/record.ts @@ -0,0 +1,110 @@ +import { expect, pick, test } from 'tstyche'; +import { List, Map, MapOf, Record, RecordOf, Set } from 'immutable'; + +test('Factory', () => { + const PointXY = Record({ x: 0, y: 0 }); + + expect(PointXY).type.toBe>(); + + expect(PointXY({ x: 'a' })).type.toRaiseError(); + + const pointXY = PointXY(); + + expect(pointXY).type.toBe< + Record<{ x: number; y: number }> & Readonly<{ x: number; y: number }> + >(); + + expect(pick(pointXY, 'x')).type.toBe<{ readonly x: number }>(); + + expect(pick(pointXY, 'y')).type.toBe<{ readonly y: number }>(); + + expect(pointXY.toJS()).type.toBe<{ x: number; y: number }>(); + + class PointClass extends PointXY { + setX(x: number) { + return this.set('x', x); + } + + setY(y: number) { + return this.set('y', y); + } + } + + const point = new PointClass(); + + expect(point).type.toBe(); + + expect(point.x).type.toBe(); + + expect(point.y).type.toBe(); + + expect(point.setX(10)).type.toBe(); + + expect(point.setY(10)).type.toBe(); + + expect(point.toJSON()).type.toBe<{ x: number; y: number }>(); + + expect(point.toJS()).type.toBe<{ x: number; y: number }>(); +}); + +test('.getDescriptiveName', () => { + const PointXY = Record({ x: 0, y: 0 }); + + expect(Record.getDescriptiveName(PointXY())).type.toBe(); + + expect(Record.getDescriptiveName({})).type.toRaiseError(); +}); + +test('Factory', () => { + const WithMap = Record({ + map: Map({ a: 'A' }), + list: List(['a']), + set: Set(['a']), + }); + + const withMap = WithMap(); + + expect(withMap.toJSON()).type.toBe<{ + map: MapOf<{ a: string }>; + list: List; + set: Set; + }>(); + + // should be `{ map: { a: string; }; list: string[]; set: string[]; }` but there is an issue with circular references + expect(withMap.toJS()).type.toBe<{ + map: unknown; + list: unknown; + set: unknown; + }>(); +}); + +test('optional properties', () => { + interface Size { + distance: string; + } + + const Line = Record<{ size?: Size; color?: string }>({ + size: undefined, + color: 'red', + }); + + const line = Line({}); + + // should be { size?: { distance: string; } | undefined; color?: string | undefined; } but there is an issue with circular references + expect(line.toJS()).type.toBe<{ + size?: unknown; + color?: string | undefined; + }>(); +}); + +test('similar properties, but one is optional', () => { + // see https://github.com/immutable-js/immutable-js/issues/1930 + + interface Id { + value: string; + } + + expect>().type.toBeAssignableWith< + RecordOf<{ id: Id }> + >(); +}); diff --git a/type-definitions/ts-tests/repeat.ts b/type-definitions/ts-tests/repeat.ts new file mode 100644 index 0000000000..9506b753f1 --- /dev/null +++ b/type-definitions/ts-tests/repeat.ts @@ -0,0 +1,10 @@ +import { expect, test } from 'tstyche'; +import { Repeat, Seq } from 'immutable'; + +test('#constructor', () => { + expect(Repeat(0, 0)).type.toBe>(); + + expect(Repeat('a', 0)).type.toBe>(); + + expect(Repeat('a', 'b')).type.toRaiseError(); +}); diff --git a/type-definitions/ts-tests/seq.ts b/type-definitions/ts-tests/seq.ts new file mode 100644 index 0000000000..d967acaade --- /dev/null +++ b/type-definitions/ts-tests/seq.ts @@ -0,0 +1,26 @@ +import { expect, pick, test } from 'tstyche'; +import { Seq } from 'immutable'; + +test('#constructor', () => { + expect(Seq([1, 2, 3])).type.toBe>(); +}); + +test('#size', () => { + expect(pick(Seq(), 'size')).type.toBe<{ + readonly size: number | undefined; + }>(); +}); + +test('Set.Indexed concat', () => { + const s: Seq.Indexed = Seq([1]); + expect(s).type.toBe>(); + expect(s.concat([4, 5, 6])).type.toBe>(); + expect(s.concat(Seq([4, 5, 6]))).type.toBe>(); +}); + +test('Set concat', () => { + const s: Seq = Seq([1]); + expect(s).type.toBe>(); + expect(s.concat([4, 5, 6])).type.toBe>(); + expect(s.concat(Seq([4, 5, 6]))).type.toBe>(); +}); diff --git a/type-definitions/ts-tests/set.ts b/type-definitions/ts-tests/set.ts new file mode 100644 index 0000000000..9149417986 --- /dev/null +++ b/type-definitions/ts-tests/set.ts @@ -0,0 +1,274 @@ +import { expect, pick, test } from 'tstyche'; +import { Set, Map, Collection, OrderedSet } from 'immutable'; + +test('#constructor', () => { + expect(Set()).type.toBe>(); + + expect(Set()).type.toBe>(); + + expect(Set([1, 'a'])).type.toBe>(); + + expect>().type.not.toBeAssignableWith(Set([1, 'a'])); +}); + +test('#size', () => { + expect(pick(Set(), 'size')).type.toBe<{ readonly size: number }>(); +}); + +test('.of', () => { + expect(Set.of(1, 2, 3)).type.toBe>(); + + expect(Set.of('a', 1)).type.toRaiseError(); + + expect(Set.of('a', 1)).type.toBe>(); +}); + +test('.fromKeys', () => { + expect(Set.fromKeys(Map())).type.toBe>(); + + expect(Set.fromKeys(Map())).type.toBe>(); + + expect(Set.fromKeys({ a: 1 })).type.toBe>(); + + expect(Set.fromKeys(Map())).type.toRaiseError(); + + expect( + Set.fromKeys(Map()) + ).type.toBe>(); +}); + +test('#get', () => { + expect(Set().get(4)).type.toBe(); + + expect(Set().get(4, 'a')).type.toBe(); + + expect(Set().get(4, 'a')).type.toRaiseError(); +}); + +test('#delete', () => { + expect(Set().delete(0)).type.toBe>(); + + expect(Set().delete('a')).type.toRaiseError(); +}); + +test('#remove', () => { + expect(Set().remove(0)).type.toBe>(); + + expect(Set().remove('a')).type.toRaiseError(); +}); + +test('#clear', () => { + expect(Set().clear()).type.toBe>(); + + expect(Set().clear(10)).type.toRaiseError(); +}); + +test('#map', () => { + expect( + Set().map((value: number, key: number, iter: Set) => 1) + ).type.toBe>(); + + expect( + Set().map((value: number, key: number, iter: Set) => 'a') + ).type.toBe>(); + + expect( + Set().map( + (value: number, key: number, iter: Set) => 1 + ) + ).type.toBe>(); + + expect( + Set().map( + (value: number, key: number, iter: Set) => 1 + ) + ).type.toRaiseError(); + + expect( + Set().map( + (value: string, key: number, iter: Set) => 1 + ) + ).type.toRaiseError(); + + expect( + Set().map( + (value: number, key: string, iter: Set) => 1 + ) + ).type.toRaiseError(); + + expect( + Set().map( + (value: number, key: number, iter: Set) => 1 + ) + ).type.toRaiseError(); + + expect( + Set().map( + (value: number, key: number, iter: Set) => 'a' + ) + ).type.toRaiseError(); +}); + +test('#flatMap', () => { + expect( + Set().flatMap((value: number, key: number, iter: Set) => [ + 1, + ]) + ).type.toBe>(); + + expect( + Set().flatMap((value: number, key: number, iter: Set) => [ + 'a', + ]) + ).type.toBe>(); + + expect( + Set().flatMap( + (value: number, key: number, iter: Set) => [1] + ) + ).type.toBe>(); + + expect( + Set().flatMap( + (value: number, key: number, iter: Set) => [1] + ) + ).type.toRaiseError(); + + expect( + Set().flatMap( + (value: string, key: number, iter: Set) => [1] + ) + ).type.toRaiseError(); + + expect( + Set().flatMap( + (value: number, key: string, iter: Set) => [1] + ) + ).type.toRaiseError(); + + expect( + Set().flatMap( + (value: number, key: number, iter: Set) => [1] + ) + ).type.toRaiseError(); + + expect( + Set().flatMap( + (value: number, key: number, iter: Set) => ['a'] + ) + ).type.toRaiseError(); +}); + +test('#union', () => { + expect(Set().union(Set())).type.toBe>(); + + expect(Set().union(Set())).type.toBe>(); + + expect(Set().union(Set())).type.toBe< + Set + >(); + + expect(Set().union(Set())).type.toBe< + Set + >(); +}); + +test('#merge', () => { + expect(Set().merge(Set())).type.toBe>(); + + expect(Set().merge(Set())).type.toBe>(); + + expect(Set().merge(Set())).type.toBe< + Set + >(); + + expect(Set().merge(Set())).type.toBe< + Set + >(); +}); + +test('#intersect', () => { + expect(Set().intersect(Set())).type.toBe>(); + + expect(Set().intersect(Set())).type.toRaiseError(); + + expect(Set().intersect(Set())).type.toBe< + Set + >(); + + expect(Set().intersect(Set())).type.toBe< + Set + >(); +}); + +test('#subtract', () => { + expect(Set().subtract(Set())).type.toBe>(); + + expect(Set().subtract(Set())).type.toRaiseError(); + + expect(Set().subtract(Set())).type.toBe< + Set + >(); + + expect(Set().subtract(Set())).type.toBe< + Set + >(); +}); + +test('#flatten', () => { + expect(Set().flatten()).type.toBe>(); + + expect(Set().flatten(10)).type.toBe>(); + + expect(Set().flatten(false)).type.toBe< + Collection + >(); + + expect(Set().flatten('a')).type.toRaiseError(); +}); + +test('#sort', () => { + expect(Set().sort()).type.toBe & OrderedSet>(); + expect(Set().sort((a, b) => 1)).type.toBe< + Set & OrderedSet + >(); +}); + +test('#sortBy', () => { + expect(Set().sortBy((v) => v)).type.toBe< + Set & OrderedSet + >(); + + expect( + Set().sortBy( + (v) => v, + (a, b) => 1 + ) + ).type.toBe & OrderedSet>(); +}); + +test('#withMutations', () => { + expect(Set().withMutations((mutable) => mutable)).type.toBe< + Set + >(); + + expect( + Set().withMutations((mutable: Set) => mutable) + ).type.toRaiseError(); +}); + +test('#asMutable', () => { + expect(Set().asMutable()).type.toBe>(); +}); + +test('#asImmutable', () => { + expect(Set().asImmutable()).type.toBe>(); +}); + +test('#toJS', () => { + expect(Set>().toJS()).type.toBe(); +}); + +test('#toJSON', () => { + expect(Set>().toJSON()).type.toBe[]>(); +}); diff --git a/type-definitions/ts-tests/stack.ts b/type-definitions/ts-tests/stack.ts new file mode 100644 index 0000000000..d261b1152a --- /dev/null +++ b/type-definitions/ts-tests/stack.ts @@ -0,0 +1,226 @@ +import { expect, pick, test } from 'tstyche'; +import { Collection, Stack } from 'immutable'; + +test('#constructor', () => { + expect(Stack()).type.toBe>(); + + expect(Stack()).type.toBe>(); + + expect(Stack([1, 'a'])).type.toBe>(); +}); + +test('#size', () => { + expect(pick(Stack(), 'size')).type.toBe<{ readonly size: number }>(); +}); + +test('.of', () => { + expect(Stack.of(1, 2, 3)).type.toBe>(); + + expect(Stack.of('a', 1)).type.toRaiseError(); + + expect(Stack.of('a', 1)).type.toBe>(); +}); + +test('#peek', () => { + expect(Stack().peek()).type.toBe(); +}); + +test('#push', () => { + expect(Stack().push(0)).type.toBe>(); + + expect(Stack().push('a')).type.toRaiseError(); + + expect(Stack().push(0)).type.toBe>(); + + expect(Stack().push('a')).type.toBe< + Stack + >(); +}); + +test('#pushAll', () => { + expect(Stack().pushAll([0])).type.toBe>(); + + expect(Stack().pushAll(['a'])).type.toRaiseError(); + + expect(Stack().pushAll([0])).type.toBe< + Stack + >(); + + expect(Stack().pushAll(['a'])).type.toBe< + Stack + >(); +}); + +test('#unshift', () => { + expect(Stack().unshift(0)).type.toBe>(); + + expect(Stack().unshift('a')).type.toRaiseError(); + + expect(Stack().unshift(0)).type.toBe< + Stack + >(); + + expect(Stack().unshift('a')).type.toBe< + Stack + >(); +}); + +test('#unshiftAll', () => { + expect(Stack().unshiftAll([0])).type.toBe>(); + + expect(Stack().unshiftAll(['a'])).type.toRaiseError(); + + expect(Stack().unshiftAll([1])).type.toBe< + Stack + >(); + + expect(Stack().unshiftAll(['a'])).type.toBe< + Stack + >(); +}); + +test('#clear', () => { + expect(Stack().clear()).type.toBe>(); + + expect(Stack().clear(10)).type.toRaiseError(); +}); + +test('#pop', () => { + expect(Stack().pop()).type.toBe>(); + + expect(Stack().pop(10)).type.toRaiseError(); +}); + +test('#shift', () => { + expect(Stack().shift()).type.toBe>(); + + expect(Stack().shift(10)).type.toRaiseError(); +}); + +test('#map', () => { + expect( + Stack().map((value: number, key: number, iter: Stack) => 1) + ).type.toBe>(); + + expect( + Stack().map( + (value: number, key: number, iter: Stack) => 'a' + ) + ).type.toBe>(); + + expect( + Stack().map( + (value: number, key: number, iter: Stack) => 1 + ) + ).type.toBe>(); + + expect( + Stack().map( + (value: number, key: number, iter: Stack) => 1 + ) + ).type.toRaiseError(); + + expect( + Stack().map( + (value: string, key: number, iter: Stack) => 1 + ) + ).type.toRaiseError(); + + expect( + Stack().map( + (value: number, key: string, iter: Stack) => 1 + ) + ).type.toRaiseError(); + + expect( + Stack().map( + (value: number, key: number, iter: Stack) => 1 + ) + ).type.toRaiseError(); + + expect( + Stack().map( + (value: number, key: number, iter: Stack) => 'a' + ) + ).type.toRaiseError(); +}); + +test('#flatMap', () => { + expect( + Stack().flatMap( + (value: number, key: number, iter: Stack) => [1] + ) + ).type.toBe>(); + + expect( + Stack().flatMap( + (value: number, key: number, iter: Stack) => 'a' + ) + ).type.toBe>(); + + expect( + Stack().flatMap( + (value: number, key: number, iter: Stack) => [1] + ) + ).type.toBe>(); + + expect( + Stack().flatMap( + (value: number, key: number, iter: Stack) => 1 + ) + ).type.toRaiseError(); + + expect( + Stack().flatMap( + (value: string, key: number, iter: Stack) => 1 + ) + ).type.toRaiseError(); + + expect( + Stack().flatMap( + (value: number, key: string, iter: Stack) => 1 + ) + ).type.toRaiseError(); + + expect( + Stack().flatMap( + (value: number, key: number, iter: Stack) => 1 + ) + ).type.toRaiseError(); + + expect( + Stack().flatMap( + (value: number, key: number, iter: Stack) => 'a' + ) + ).type.toRaiseError(); +}); + +test('#flatten', () => { + expect(Stack().flatten()).type.toBe>(); + + expect(Stack().flatten(10)).type.toBe>(); + + expect(Stack().flatten(false)).type.toBe< + Collection + >(); + + expect(Stack().flatten('a')).type.toRaiseError(); +}); + +test('#withMutations', () => { + expect(Stack().withMutations((mutable) => mutable)).type.toBe< + Stack + >(); + + expect( + Stack().withMutations((mutable: Stack) => mutable) + ).type.toRaiseError(); +}); + +test('#asMutable', () => { + expect(Stack().asMutable()).type.toBe>(); +}); + +test('#asImmutable', () => { + expect(Stack().asImmutable()).type.toBe>(); +}); diff --git a/type-definitions/ts-tests/tsconfig.json b/type-definitions/ts-tests/tsconfig.json new file mode 100644 index 0000000000..12fa9cfb76 --- /dev/null +++ b/type-definitions/ts-tests/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "es2015", + "module": "commonjs", + "sourceMap": true, + "strict": true, + "types": [], + "noEmit": true, + "lib": ["es2015"], + "baseUrl": "./", + "paths": { + "immutable": ["../immutable.d.ts"] + } + }, + "exclude": ["node_modules"] +} diff --git a/type-definitions/tsconfig.json b/type-definitions/tsconfig.json new file mode 100644 index 0000000000..18735e2da8 --- /dev/null +++ b/type-definitions/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "es2015", + "module": "commonjs", + "sourceMap": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "lib": ["es2015"], + "types": [] + }, + "files": ["immutable.d.ts"] +} diff --git a/website/.eslintrc b/website/.eslintrc new file mode 100644 index 0000000000..97a2bb84ef --- /dev/null +++ b/website/.eslintrc @@ -0,0 +1,3 @@ +{ + "extends": ["next", "next/core-web-vitals"] +} diff --git a/website/next-env.d.ts b/website/next-env.d.ts new file mode 100644 index 0000000000..1b3be0840f --- /dev/null +++ b/website/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/website/next-sitemap.config.js b/website/next-sitemap.config.js new file mode 100644 index 0000000000..e4cc9ee5dd --- /dev/null +++ b/website/next-sitemap.config.js @@ -0,0 +1,16 @@ +// eslint-disable-next-line @typescript-eslint/no-require-imports, no-undef +const { getVersions } = require('./src/static/getVersions'); + +/** @type {import('next-sitemap').IConfig} */ +// eslint-disable-next-line no-undef +module.exports = { + siteUrl: 'https://immutable-js.com', + generateRobotsTxt: true, + outDir: './out', + exclude: [ + '/docs', + ...getVersions() + .slice(1) + .map((version) => `/docs/${version}/*`), + ], +}; diff --git a/website/next.config.js b/website/next.config.js new file mode 100644 index 0000000000..61576f7219 --- /dev/null +++ b/website/next.config.js @@ -0,0 +1,6 @@ +// eslint-disable-next-line no-undef +module.exports = { + reactStrictMode: true, + trailingSlash: true, + output: 'export', +}; diff --git a/website/public/Immutable-Data-and-React-YouTube.png b/website/public/Immutable-Data-and-React-YouTube.png new file mode 100644 index 0000000000..fd5354bd80 Binary files /dev/null and b/website/public/Immutable-Data-and-React-YouTube.png differ diff --git a/website/public/favicon.png b/website/public/favicon.png new file mode 100644 index 0000000000..405ac768e2 Binary files /dev/null and b/website/public/favicon.png differ diff --git a/website/src/ArrowDown.tsx b/website/src/ArrowDown.tsx new file mode 100644 index 0000000000..662f63466c --- /dev/null +++ b/website/src/ArrowDown.tsx @@ -0,0 +1,31 @@ +import type { JSX } from 'react'; + +export function ArrowDown({ isActive }: { isActive: boolean }): JSX.Element { + return ( + + + + + + ); +} diff --git a/website/src/Defs.tsx b/website/src/Defs.tsx new file mode 100644 index 0000000000..a8a464643d --- /dev/null +++ b/website/src/Defs.tsx @@ -0,0 +1,428 @@ +import type { FocusEvent, JSX, MouseEvent, ReactNode } from 'react'; +import { Fragment, useCallback, useState } from 'react'; +import Link from 'next/link'; +import { + TypeKind, + Type, + InterfaceDefinition, + ObjectMember, + CallSignature, + CallParam, +} from './TypeDefs'; + +export function InterfaceDef({ + name, + def, +}: { + name: string; + def: InterfaceDefinition; +}) { + return ( + + type + {name} + {def.typeParams && ( + <> + {'<'} + {interpose( + ', ', + def.typeParams.map((t, i) => ( + + {t} + + )) + )} + {'>'} + + )} + {def.extends && ( + <> + extends + {interpose( + ', ', + def.extends.map((e, i) => ) + )} + + )} + {def.implements && ( + <> + implements + {interpose( + ', ', + def.implements.map((e, i) => ) + )} + + )} + + ); +} + +export function CallSigDef({ + name, + callSig, +}: { + name: string; + callSig?: CallSignature; +}) { + const shouldWrap = callSigLength(name, callSig) > 80; + + return ( + + {name} + {callSig?.typeParams && ( + <> + {'<'} + {interpose( + ', ', + callSig.typeParams.map((t, i) => ( + + {t} + + )) + )} + {'>'} + + )} + {'('} + {callSig && functionParams(callSig.params, shouldWrap)} + {')'} + {callSig?.type && ( + <> + {': '} + + + )} + + ); +} + +export function TypeDef({ type, prefix }: { type: Type; prefix?: number }) { + switch (type.k) { + case TypeKind.Never: + return wrap('primitive', 'never'); + case TypeKind.Any: + return wrap('primitive', 'any'); + case TypeKind.Unknown: + return wrap('primitive', 'unknown'); + case TypeKind.This: + return wrap('primitive', 'this'); + case TypeKind.Undefined: + return wrap('primitive', 'undefined'); + case TypeKind.Boolean: + return wrap('primitive', 'boolean'); + case TypeKind.Number: + return wrap('primitive', 'number'); + case TypeKind.String: + return wrap('primitive', 'string'); + case TypeKind.Union: + return wrap( + 'union', + interpose( + ' | ', + type.types.map((t, i) => ) + ) + ); + case TypeKind.Intersection: + return wrap( + 'intersection', + interpose( + ' & ', + type.types.map((t, i) => ) + ) + ); + case TypeKind.Tuple: + return wrap( + 'tuple', + <> + {'['} + {interpose( + ', ', + type.types.map((t, i) => ) + )} + {']'} + + ); + case TypeKind.Object: + if (!type.members) { + return wrap('primitive', 'object'); + } + return wrap( + 'object', + <> + {'{'} + {interpose( + ', ', + type.members.map((t, i) => ) + )} + {'}'} + + ); + case TypeKind.Indexed: + return wrap( + 'indexed', + <> + ,{'['} + + {']'} + + ); + case TypeKind.Operator: + return wrap( + 'operator', + <> + {wrap('primitive', type.operator)} + + ); + case TypeKind.Array: + return wrap( + 'array', + <> + + {'[]'} + + ); + case TypeKind.Function: { + const shouldWrap = (prefix || 0) + funcLength(type) > 78; + return wrap( + 'function', + <> + {type.typeParams && ( + <> + {'<'} + {interpose( + ', ', + type.typeParams.map((t, i) => ( + + {t} + + )) + )} + {'>'} + + )} + {'('} + {functionParams(type.params, shouldWrap)} + {') => '} + + + ); + } + case TypeKind.Param: + return wrap('typeParam', type.param); + case TypeKind.Type: { + return wrap( + 'type', + <> + {type.url ? ( + + {type.name} + + ) : ( + {type.name} + )} + {type.args && ( + <> + {'<'} + {interpose( + ', ', + type.args.map((a, i) => ) + )} + {'>'} + + )} + + ); + } + } + throw new Error('Type with unknown kind ' + JSON.stringify(type)); +} + +function wrap(className: string, child: ReactNode) { + return {child}; +} + +function Hover({ + className, + children, +}: { + className?: string; + children: ReactNode; +}) { + const [isOver, setIsOver] = useState(false); + const mouseOver = useCallback( + (event: MouseEvent | FocusEvent) => { + event.stopPropagation(); + setIsOver(true); + }, + [setIsOver] + ); + const mouseOut = useCallback(() => { + setIsOver(false); + }, [setIsOver]); + return ( + + {children} + + ); +} + +export function MemberDef({ member }: { member: ObjectMember }) { + return ( + + {member.index ? ( + <>[{functionParams(member.params, false)}] + ) : ( + {member.name} + )} + {member.type && ( + <> + : + + )} + + ); +} + +function functionParams( + params: Array | undefined, + shouldWrap: boolean +) { + const elements = interpose( + shouldWrap ? ( + <> + {','} +
+ + ) : ( + ', ' + ), + (params ?? []).map((t, i) => ( + + {t.varArgs ? '...' : null} + {t.name} + {t.optional ? '?: ' : ': '} + + + )) + ); + + return shouldWrap ? ( +
{elements}
+ ) : ( + elements + ); +} + +function callSigLength(name: string, sig?: CallSignature): number { + return name.length + (sig ? funcLength(sig) : 2); +} + +function funcLength(sig: CallSignature): number { + return ( + (sig.typeParams ? 2 + sig.typeParams.join(', ').length : 0) + + 2 + + (sig.params ? paramLength(sig.params) : 0) + + (sig.type ? 2 + typeLength(sig.type) : 0) + ); +} + +function paramLength(params: Array): number { + return params.reduce( + (s, p) => + s + + (p.varArgs ? 3 : 0) + + p.name.length + + (p.optional ? 3 : 2) + + typeLength(p.type), + (params.length - 1) * 2 + ); +} + +function memberLength(members: Array): number { + return members.reduce( + (s, m) => + s + + (m.index ? paramLength(m.params || []) + 2 : m.name!.length) + + (m.type ? typeLength(m.type) + 2 : 0), + (members.length - 1) * 2 + ); +} + +function typeLength(type: Type): number { + if (!type) { + throw new Error('Expected type'); + } + switch (type.k) { + case TypeKind.Never: + return 5; + case TypeKind.Any: + return 3; + case TypeKind.Unknown: + return 7; + case TypeKind.This: + return 4; + case TypeKind.Undefined: + return 9; + case TypeKind.Boolean: + return 7; + case TypeKind.Number: + return 6; + case TypeKind.String: + return 6; + case TypeKind.Union: + case TypeKind.Intersection: + return ( + type.types.reduce((s, t) => s + typeLength(t), 0) + + (type.types.length - 1) * 3 + ); + case TypeKind.Tuple: + return ( + 2 + + type.types.reduce((s, t) => s + typeLength(t), 0) + + (type.types.length - 1) * 2 + ); + case TypeKind.Object: + return type.members ? 2 + memberLength(type.members) : 6; + case TypeKind.Indexed: + return 2 + typeLength(type.type) + typeLength(type.index); + case TypeKind.Operator: + return 1 + type.operator.length + typeLength(type.type); + case TypeKind.Array: + return typeLength(type.type) + 2; + case TypeKind.Function: + return 2 + funcLength(type); + case TypeKind.Param: + return type.param.length; + case TypeKind.Type: + return ( + type.name.length + + (!type.args + ? 0 + : type.args.reduce((s, a) => s + typeLength(a), type.args.length * 2)) + ); + } + throw new Error('Type with unknown kind ' + JSON.stringify(type)); +} + +function interpose( + between: ReactNode, + array: Array +): Array { + const result: Array = []; + let i = 0; + for (const value of array) { + result.push(value, {between}); + } + result.pop(); + + return result; +} diff --git a/website/src/DocHeader.tsx b/website/src/DocHeader.tsx new file mode 100644 index 0000000000..b57499a864 --- /dev/null +++ b/website/src/DocHeader.tsx @@ -0,0 +1,20 @@ +import { HeaderLinks, HeaderLogoLink } from './Header'; + +export function DocHeader({ + versions, + currentVersion, +}: { + versions: Array; + currentVersion?: string; +}) { + return ( +
+
+
+ + +
+
+
+ ); +} diff --git a/website/src/DocOverview.tsx b/website/src/DocOverview.tsx new file mode 100644 index 0000000000..71a62ce155 --- /dev/null +++ b/website/src/DocOverview.tsx @@ -0,0 +1,57 @@ +import Link from 'next/link'; +import { MarkdownContent } from './MarkdownContent'; +import type { TypeDefs, TypeDoc } from './TypeDefs'; + +export type OverviewData = { + doc: TypeDoc | null; + api: Array; +}; + +type APIMember = { + label: string; + url: string; + synopsis?: string; +}; + +// Static use only +export function getOverviewData(defs: TypeDefs): OverviewData { + return { + doc: defs.doc || null, + api: Object.values(defs.types).map((def) => { + const member: APIMember = { label: def.label, url: def.url }; + const doc = def.doc || def.call?.doc; + if (doc?.synopsis) { + member.synopsis = doc?.synopsis; + } + return member; + }), + }; +} + +export function DocOverview({ data }: { data: OverviewData }) { + return ( +
+ {data.doc && ( +
+ + {data.doc.description && ( + + )} +
+ )} + +

API

+ + {data.api.map((member) => ( +
+

+ {member.label} +

+ {member.synopsis && ( + + )} +
+ ))} +
+ ); +} diff --git a/website/src/DocSearch.tsx b/website/src/DocSearch.tsx new file mode 100644 index 0000000000..82e07cf313 --- /dev/null +++ b/website/src/DocSearch.tsx @@ -0,0 +1,53 @@ +'use client'; + +import { useEffect, useState } from 'react'; + +export function DocSearch() { + const [enabled, setEnabled] = useState(null); + + useEffect(() => { + const script = document.createElement('script'); + const firstScript = document.getElementsByTagName('script')[0]; + script.src = + 'https://cdn.jsdelivr.net/npm/docsearch.js@2.5.2/dist/cdn/docsearch.min.js'; + script.addEventListener( + 'load', + () => { + // Initialize Algolia search. + // @ts-expect-error -- algolia is set on windows, need proper type + if (window.docsearch) { + // @ts-expect-error -- algolia is set on windows, need proper type + window.docsearch({ + apiKey: '83f61f865ef4cb682e0432410c2f7809', + indexName: 'immutable_js', + inputSelector: '#algolia-docsearch', + }); + setEnabled(true); + } else { + setEnabled(false); + } + }, + false + ); + firstScript?.parentNode?.insertBefore(script, firstScript); + + const link = document.createElement('link'); + const firstLink = document.getElementsByTagName('link')[0]; + link.rel = 'stylesheet'; + link.href = + 'https://cdn.jsdelivr.net/npm/docsearch.js@2.5.2/dist/cdn/docsearch.min.css'; + firstLink?.parentNode?.insertBefore(link, firstLink); + }, []); + + if (enabled === false) return null; + + return ( + + ); +} diff --git a/website/src/Header.tsx b/website/src/Header.tsx new file mode 100644 index 0000000000..b8e8b67d9e --- /dev/null +++ b/website/src/Header.tsx @@ -0,0 +1,198 @@ +'use client'; + +import { useState, useEffect } from 'react'; +import Link from 'next/link'; + +import { SVGSet } from './SVGSet'; +import { Logo } from './Logo'; +import { StarBtn } from './StarBtn'; +import { isMobile } from './isMobile'; + +export function Header({ + versions, + currentVersion, +}: { + versions: Array; + currentVersion?: string; +}) { + const [scroll, setScroll] = useState(0); + + useEffect(() => { + let _pending = false; + function handleScroll() { + if (!_pending) { + const headerHeight = Math.min( + 800, + Math.max(260, document.documentElement.clientHeight * 0.7) + ); + if (window.scrollY < headerHeight) { + _pending = true; + window.requestAnimationFrame(() => { + _pending = false; + setScroll(window.scrollY); + }); + } + } + } + + window.addEventListener('scroll', handleScroll); + return () => { + window.removeEventListener('scroll', handleScroll); + }; + }, []); + + const neg = scroll < 0; + const s = neg ? 0 : scroll; + const sp = isMobile() ? 35 : 70; + + return ( +
+
+
+ + +
+
+
+
+
+
+
+ +
+
+
+
+ {[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0].map((_, i) => ( + + + + + ))} + + + + +
+
+
+ +
+
+
+
+
+ ); +} + +export function HeaderLogoLink() { + return ( + + + + + + + ); +} + +export function HeaderLinks({ + versions, + currentVersion, +}: { + versions: Array; + currentVersion?: string; +}) { + return ( +
+ ); +} + +function DocsDropdown({ + versions, + currentVersion, +}: { + versions: Array; + currentVersion?: string; +}) { + return ( +
+ +
+ + Docs{currentVersion && ` (${currentVersion})`} + +
+
    + {versions.map((v) => ( +
  • + {v} +
  • + ))} +
+
+ ); +} + +function ty(s: number, p: number) { + return (p < s ? p : s) * -0.55; +} + +function o(s: number, p: number) { + return Math.max(0, s > p ? 1 - (s - p) / 350 : 1); +} + +function tz(s: number, p: number) { + return Math.max(0, s > p ? 1 - (s - p) / 20000 : 1); +} + +function t(y: number, z: number) { + return { transform: 'translate3d(0, ' + y + 'px, 0) scale(' + z + ')' }; +} diff --git a/website/src/ImmutableConsole.tsx b/website/src/ImmutableConsole.tsx new file mode 100644 index 0000000000..4875a22058 --- /dev/null +++ b/website/src/ImmutableConsole.tsx @@ -0,0 +1,69 @@ +'use client'; + +import { useEffect } from 'react'; + +type InstallSpace = { + Immutable?: unknown; + module?: unknown; + exports?: unknown; +}; + +let installingVersion: string | undefined; + +export function ImmutableConsole({ version }: { version: string }) { + useEffect(() => { + const installSpace = global as unknown as InstallSpace; + if (installingVersion === version) { + return; + } + installingVersion = version; + installUMD(installSpace, getSourceURL(version)).then((Immutable) => { + installSpace.Immutable = Immutable; + + console.log( + '\n' + + ' ▄▟████▙▄ _ __ __ __ __ _ _ _______ ____ _ _____ \n' + + ' ▟██████████▙ | | | \\ / | \\ / | | | |__ __|/\\ | _ \\| | | ___|\n' + + '██████████████ | | | \\/ | \\/ | | | | | | / \\ | |_) | | | |__ \n' + + '██████████████ | | | |\\ /| | |\\ /| | | | | | | / /\\ \\ | _ <| | | __| \n' + + ' ▜██████████▛ | | | | \\/ | | | \\/ | | |__| | | |/ ____ \\| |_) | |___| |___ \n' + + ' ▀▜████▛▀ |_| |_| |_|_| |_|\\____/ |_/_/ \\_\\____/|_____|_____|\n' + + '\n' + + `Version: ${version}\n` + + '> console.log(Immutable);' + ); + console.log(Immutable); + }); + }, [version]); + return null; +} + +function getSourceURL(version: string) { + if (version === 'latest@main') { + return `https://cdn.jsdelivr.net/gh/immutable-js/immutable-js@npm/dist/immutable.js`; + } + const semver = version[0] === 'v' ? version.slice(1) : version; + return `https://cdn.jsdelivr.net/npm/immutable@${semver}/dist/immutable.js`; +} + +function installUMD(installSpace: InstallSpace, src: string): Promise { + return new Promise((resolve) => { + const installedModule = (installSpace.module = { + exports: (installSpace.exports = {}), + }); + const script = document.createElement('script'); + const firstScript = document.getElementsByTagName('script')[0]; + script.src = src; + script.addEventListener( + 'load', + () => { + installSpace.module = undefined; + installSpace.exports = undefined; + script.remove(); + resolve(installedModule.exports); + }, + false + ); + firstScript?.parentNode?.insertBefore(script, firstScript); + }); +} diff --git a/website/src/Logo.tsx b/website/src/Logo.tsx new file mode 100644 index 0000000000..b9c0bb5e7c --- /dev/null +++ b/website/src/Logo.tsx @@ -0,0 +1,74 @@ +type Props = { + opacity?: number; + inline?: boolean; + color: string; +}; + +export function Logo({ opacity = 1, inline, color }: Props) { + return !inline ? ( + + + + + + + + + + + + ) : ( + + + + + + + + + + + + ); +} diff --git a/website/src/MarkdownContent.tsx b/website/src/MarkdownContent.tsx new file mode 100644 index 0000000000..7f90fca400 --- /dev/null +++ b/website/src/MarkdownContent.tsx @@ -0,0 +1,33 @@ +'use client'; + +import { memo, MouseEvent } from 'react'; +import { useRouter } from 'next/navigation'; + +type Props = { + contents: string; + className?: string; +}; + +// eslint-disable-next-line prefer-arrow-callback +export const MarkdownContent = memo(function MarkdownContent({ + contents, + className, +}) { + const router = useRouter(); + + const handleClick = (event: MouseEvent) => { + const link = event.target as HTMLAnchorElement; + if (link.tagName === 'A' && link.target !== '_blank') { + event.preventDefault(); + router.push(link.href); + } + }; + + return ( +
+ ); +}); diff --git a/website/src/MemberDoc.tsx b/website/src/MemberDoc.tsx new file mode 100644 index 0000000000..7d36ff2c52 --- /dev/null +++ b/website/src/MemberDoc.tsx @@ -0,0 +1,100 @@ +import Link from 'next/link'; +import { Fragment } from 'react'; +import { CallSigDef, MemberDef } from './Defs'; +import { MarkdownContent } from './MarkdownContent'; +import type { MemberDefinition } from './TypeDefs'; + +export function MemberDoc({ member }: { member: MemberDefinition }) { + return ( +
+

+ {member.label} +

+
+ {member.doc && ( + + )} + {!member.signatures ? ( + + + + ) : ( + + {member.signatures.map((callSig, i) => ( + + + {'\n'} + + ))} + + )} + {member.inherited && ( +
+

Inherited from

+ + + {member.inherited.interface}#{member.inherited.label} + + +
+ )} + {member.overrides && ( +
+

Overrides

+ + + {member.overrides.interface}#{member.overrides.label} + + +
+ )} + {member.doc?.notes.map((note, i) => ( +
+

{note.name}

+ {note.name === 'alias' ? ( + + + + ) : ( + + )} +
+ ))} + {member.doc?.description && ( +
+

+ {member.doc.description.slice(0, 5) === ' + +

+ )} +
+
+ ); +} + +// export type ParamTypeMap = { [param: string]: Type }; + +// function getParamTypeMap( +// interfaceDef: InterfaceDefinition | undefined, +// member: MemberDefinition +// ): ParamTypeMap | undefined { +// if (!member.inherited || !interfaceDef?.typeParamsMap) return; +// const defining = member.inherited.split('#')[0] + '>'; +// const paramTypeMap: ParamTypeMap = {}; +// // Filter typeParamsMap down to only those relevant to the defining interface. +// for (const [path, type] of Object.entries(interfaceDef.typeParamsMap)) { +// if (path.startsWith(defining)) { +// paramTypeMap[path.slice(defining.length)] = type; +// } +// } +// return paramTypeMap; +// } diff --git a/website/src/RunkitEmbed.tsx b/website/src/RunkitEmbed.tsx new file mode 100644 index 0000000000..8b394671c1 --- /dev/null +++ b/website/src/RunkitEmbed.tsx @@ -0,0 +1,153 @@ +import Script from 'next/script'; + +export function RunkitEmbed() { + return